@kuadrant/kuadrant-backstage-plugin-frontend 0.0.2-dev-24d0757 → 0.0.2-dev-7d09bfa
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/dist/components/ApiAccessCard/ApiAccessCard.esm.js +229 -11
- package/dist/components/ApiAccessCard/ApiAccessCard.esm.js.map +1 -1
- package/dist/components/ApiKeyManagementTab/ApiKeyManagementTab.esm.js +15 -151
- package/dist/components/ApiKeyManagementTab/ApiKeyManagementTab.esm.js.map +1 -1
- package/dist/components/ApiProductDetailPage/ApiProductDetailPage.esm.js +25 -6
- package/dist/components/ApiProductDetailPage/ApiProductDetailPage.esm.js.map +1 -1
- package/dist/components/ApiProductDetails/ApiProductDetails.esm.js +6 -1
- package/dist/components/ApiProductDetails/ApiProductDetails.esm.js.map +1 -1
- package/dist/components/ApiProductInfoCard/ApiProductInfoCard.esm.js +15 -2
- package/dist/components/ApiProductInfoCard/ApiProductInfoCard.esm.js.map +1 -1
- package/dist/components/CreateAPIProductDialog/CreateAPIProductDialog.esm.js +2 -4
- package/dist/components/CreateAPIProductDialog/CreateAPIProductDialog.esm.js.map +1 -1
- package/dist/components/OidcProviderCard/OidcProviderCard.esm.js +23 -0
- package/dist/components/OidcProviderCard/OidcProviderCard.esm.js.map +1 -0
- package/dist/components/RequestAccessDialog/RequestAccessDialog.esm.js +167 -0
- package/dist/components/RequestAccessDialog/RequestAccessDialog.esm.js.map +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.esm.js +1 -1
- package/dist/plugin.esm.js +1 -9
- package/dist/plugin.esm.js.map +1 -1
- package/dist/utils/validation.esm.js.map +1 -1
- package/dist-scalprum/configSchema.json +27 -1
- package/dist-scalprum/internal.plugin-kuadrant.5d9e1e73c7f21bbed39a.js +2 -0
- package/dist-scalprum/internal.plugin-kuadrant.5d9e1e73c7f21bbed39a.js.map +1 -0
- package/dist-scalprum/plugin-manifest.json +2 -2
- package/dist-scalprum/static/1994.19e6a1c5.chunk.js +3 -0
- package/dist-scalprum/static/1994.19e6a1c5.chunk.js.map +1 -0
- package/dist-scalprum/static/{2628.6619bf8b.chunk.js → 2628.0605e07f.chunk.js} +3 -3
- package/dist-scalprum/static/2628.0605e07f.chunk.js.map +1 -0
- package/dist-scalprum/static/2752.df63f31c.chunk.js +2 -0
- package/dist-scalprum/static/2752.df63f31c.chunk.js.map +1 -0
- package/dist-scalprum/static/2822.27a4ac5b.chunk.js +2 -0
- package/dist-scalprum/static/2822.27a4ac5b.chunk.js.map +1 -0
- package/dist-scalprum/static/2967.8d9c1b1f.chunk.js +2 -0
- package/dist-scalprum/static/2967.8d9c1b1f.chunk.js.map +1 -0
- package/dist-scalprum/static/{3097.4bd6b35f.chunk.js → 3097.582b68d3.chunk.js} +2 -2
- package/dist-scalprum/static/{3097.4bd6b35f.chunk.js.map → 3097.582b68d3.chunk.js.map} +1 -1
- package/dist-scalprum/static/327.cd6b3fee.chunk.js +2 -0
- package/dist-scalprum/static/327.cd6b3fee.chunk.js.map +1 -0
- package/dist-scalprum/static/3459.a7c29521.chunk.js +2 -0
- package/dist-scalprum/static/3459.a7c29521.chunk.js.map +1 -0
- package/dist-scalprum/static/3584.c820a5c7.chunk.js +2 -0
- package/dist-scalprum/static/3584.c820a5c7.chunk.js.map +1 -0
- package/dist-scalprum/static/3587.490690d6.chunk.js +2 -0
- package/dist-scalprum/static/3587.490690d6.chunk.js.map +1 -0
- package/dist-scalprum/static/{3647.b96f9b3e.chunk.js → 3647.67079e5f.chunk.js} +2 -2
- package/dist-scalprum/static/{3647.b96f9b3e.chunk.js.map → 3647.67079e5f.chunk.js.map} +1 -1
- package/dist-scalprum/static/3650.4f0dc550.chunk.js +2 -0
- package/dist-scalprum/static/3650.4f0dc550.chunk.js.map +1 -0
- package/dist-scalprum/static/3947.7458971d.chunk.js +2 -0
- package/dist-scalprum/static/3947.7458971d.chunk.js.map +1 -0
- package/dist-scalprum/static/3984.7bc07774.chunk.js +2 -0
- package/dist-scalprum/static/3984.7bc07774.chunk.js.map +1 -0
- package/dist-scalprum/static/4302.9a59485e.chunk.js +2 -0
- package/dist-scalprum/static/4302.9a59485e.chunk.js.map +1 -0
- package/dist-scalprum/static/441.f708f1e0.chunk.js +2 -0
- package/dist-scalprum/static/441.f708f1e0.chunk.js.map +1 -0
- package/dist-scalprum/static/4611.0d064cdf.chunk.js +2 -0
- package/dist-scalprum/static/4611.0d064cdf.chunk.js.map +1 -0
- package/dist-scalprum/static/4651.c85cecc4.chunk.js +2 -0
- package/dist-scalprum/static/4651.c85cecc4.chunk.js.map +1 -0
- package/dist-scalprum/static/{4682.6959fcd1.chunk.js → 4682.3c7098a8.chunk.js} +2 -2
- package/dist-scalprum/static/{4682.6959fcd1.chunk.js.map → 4682.3c7098a8.chunk.js.map} +1 -1
- package/dist-scalprum/static/501.87de76da.chunk.js +3 -0
- package/dist-scalprum/static/501.87de76da.chunk.js.LICENSE.txt +21 -0
- package/dist-scalprum/static/501.87de76da.chunk.js.map +1 -0
- package/dist-scalprum/static/{5010.a4aa0f8e.chunk.js → 5010.2228c754.chunk.js} +3 -3
- package/dist-scalprum/static/{5010.a4aa0f8e.chunk.js.map → 5010.2228c754.chunk.js.map} +1 -1
- package/dist-scalprum/static/5203.43732b3f.chunk.js +2 -0
- package/dist-scalprum/static/5203.43732b3f.chunk.js.map +1 -0
- package/dist-scalprum/static/5235.2a59dc45.chunk.js +2 -0
- package/dist-scalprum/static/5235.2a59dc45.chunk.js.map +1 -0
- package/dist-scalprum/static/5453.b3ee2392.chunk.js +2 -0
- package/dist-scalprum/static/5453.b3ee2392.chunk.js.map +1 -0
- package/dist-scalprum/static/{7556.aa8a002f.chunk.js → 5568.5dbce633.chunk.js} +3 -3
- package/dist-scalprum/static/{3466.43dfe991.chunk.js.LICENSE.txt → 5568.5dbce633.chunk.js.LICENSE.txt} +9 -0
- package/dist-scalprum/static/5568.5dbce633.chunk.js.map +1 -0
- package/dist-scalprum/static/6272.ef31cb1c.chunk.js +2 -0
- package/dist-scalprum/static/6272.ef31cb1c.chunk.js.map +1 -0
- package/dist-scalprum/static/6371.c4899d73.chunk.js +3 -0
- package/dist-scalprum/static/6371.c4899d73.chunk.js.map +1 -0
- package/dist-scalprum/static/6386.6386.ce38cef3.css +5 -0
- package/dist-scalprum/static/6386.6386.ce38cef3.css.map +1 -0
- package/dist-scalprum/static/6386.903891f3.chunk.js +3 -0
- package/dist-scalprum/static/6386.903891f3.chunk.js.LICENSE.txt +26 -0
- package/dist-scalprum/static/6386.903891f3.chunk.js.map +1 -0
- package/dist-scalprum/static/65.0e01be7c.chunk.js +2 -0
- package/dist-scalprum/static/65.0e01be7c.chunk.js.map +1 -0
- package/dist-scalprum/static/6753.76832e72.chunk.js +2 -0
- package/dist-scalprum/static/6753.76832e72.chunk.js.map +1 -0
- package/dist-scalprum/static/{8563.7e068fb0.chunk.js → 6763.d6cd937f.chunk.js} +3 -3
- package/dist-scalprum/static/6763.d6cd937f.chunk.js.map +1 -0
- package/dist-scalprum/static/{6800.736d5da3.chunk.js → 6800.8ec3a2eb.chunk.js} +2 -2
- package/dist-scalprum/static/6800.8ec3a2eb.chunk.js.map +1 -0
- package/dist-scalprum/static/{6840.4728fab9.chunk.js → 6840.6cc88a16.chunk.js} +2 -2
- package/dist-scalprum/static/6840.6cc88a16.chunk.js.map +1 -0
- package/dist-scalprum/static/7076.8745d395.chunk.js +2 -0
- package/dist-scalprum/static/7076.8745d395.chunk.js.map +1 -0
- package/dist-scalprum/static/7367.62c9669e.chunk.js +3 -0
- package/dist-scalprum/static/7367.62c9669e.chunk.js.LICENSE.txt +21 -0
- package/dist-scalprum/static/7367.62c9669e.chunk.js.map +1 -0
- package/dist-scalprum/static/7791.55db7365.chunk.js +2 -0
- package/dist-scalprum/static/7791.55db7365.chunk.js.map +1 -0
- package/dist-scalprum/static/8172.e89bbae7.chunk.js +2 -0
- package/dist-scalprum/static/8172.e89bbae7.chunk.js.map +1 -0
- package/dist-scalprum/static/8627.111cbac9.chunk.js +2 -0
- package/dist-scalprum/static/8627.111cbac9.chunk.js.map +1 -0
- package/dist-scalprum/static/8799.4ea4639c.chunk.js +2 -0
- package/dist-scalprum/static/8799.4ea4639c.chunk.js.map +1 -0
- package/dist-scalprum/static/9510.e4112e19.chunk.js +3 -0
- package/dist-scalprum/static/{2946.167c50c2.chunk.js.LICENSE.txt → 9510.e4112e19.chunk.js.LICENSE.txt} +0 -10
- package/dist-scalprum/static/9510.e4112e19.chunk.js.map +1 -0
- package/dist-scalprum/static/9644.7d342123.chunk.js +2 -0
- package/dist-scalprum/static/9644.7d342123.chunk.js.map +1 -0
- package/dist-scalprum/static/993.c164940e.chunk.js +2 -0
- package/dist-scalprum/static/993.c164940e.chunk.js.map +1 -0
- package/dist-scalprum/static/exposed-PluginRoot.5b6638e2.chunk.js +2 -0
- package/dist-scalprum/static/exposed-PluginRoot.5b6638e2.chunk.js.map +1 -0
- package/package.json +3 -1
- package/dist/components/PlanPolicyDetailPage/PlanPolicyDetailPage.esm.js +0 -89
- package/dist/components/PlanPolicyDetailPage/PlanPolicyDetailPage.esm.js.map +0 -1
- package/dist/components/PlanPolicyDetailPage/index.esm.js +0 -2
- package/dist/components/PlanPolicyDetailPage/index.esm.js.map +0 -1
- package/dist-scalprum/internal.plugin-kuadrant.95817f34e88db81b5e8f.js +0 -2
- package/dist-scalprum/internal.plugin-kuadrant.95817f34e88db81b5e8f.js.map +0 -1
- package/dist-scalprum/static/1085.536aa0fa.chunk.js +0 -3
- package/dist-scalprum/static/1085.536aa0fa.chunk.js.map +0 -1
- package/dist-scalprum/static/1613.71f0fccd.chunk.js +0 -3
- package/dist-scalprum/static/1613.71f0fccd.chunk.js.LICENSE.txt +0 -10
- package/dist-scalprum/static/1613.71f0fccd.chunk.js.map +0 -1
- package/dist-scalprum/static/1836.b74b4c40.chunk.js +0 -3
- package/dist-scalprum/static/1836.b74b4c40.chunk.js.LICENSE.txt +0 -10
- package/dist-scalprum/static/1836.b74b4c40.chunk.js.map +0 -1
- package/dist-scalprum/static/2198.5905970e.chunk.js +0 -2
- package/dist-scalprum/static/2198.5905970e.chunk.js.map +0 -1
- package/dist-scalprum/static/2628.6619bf8b.chunk.js.map +0 -1
- package/dist-scalprum/static/2759.fceb317f.chunk.js +0 -2
- package/dist-scalprum/static/2759.fceb317f.chunk.js.map +0 -1
- package/dist-scalprum/static/2928.4303c12e.chunk.js +0 -3
- package/dist-scalprum/static/2928.4303c12e.chunk.js.map +0 -1
- package/dist-scalprum/static/2946.167c50c2.chunk.js +0 -3
- package/dist-scalprum/static/2946.167c50c2.chunk.js.map +0 -1
- package/dist-scalprum/static/2967.ac3a4bee.chunk.js +0 -2
- package/dist-scalprum/static/2967.ac3a4bee.chunk.js.map +0 -1
- package/dist-scalprum/static/2987.1da15560.chunk.js +0 -2
- package/dist-scalprum/static/2987.1da15560.chunk.js.map +0 -1
- package/dist-scalprum/static/3459.5c90b5a3.chunk.js +0 -2
- package/dist-scalprum/static/3459.5c90b5a3.chunk.js.map +0 -1
- package/dist-scalprum/static/3466.43dfe991.chunk.js +0 -3
- package/dist-scalprum/static/3466.43dfe991.chunk.js.map +0 -1
- package/dist-scalprum/static/3503.66b6e510.chunk.js +0 -2
- package/dist-scalprum/static/3503.66b6e510.chunk.js.map +0 -1
- package/dist-scalprum/static/3650.515c743a.chunk.js +0 -2
- package/dist-scalprum/static/3650.515c743a.chunk.js.map +0 -1
- package/dist-scalprum/static/3657.59d45756.chunk.js +0 -3
- package/dist-scalprum/static/3657.59d45756.chunk.js.LICENSE.txt +0 -10
- package/dist-scalprum/static/3657.59d45756.chunk.js.map +0 -1
- package/dist-scalprum/static/428.0a290bc6.chunk.js +0 -2
- package/dist-scalprum/static/428.0a290bc6.chunk.js.map +0 -1
- package/dist-scalprum/static/441.9f02e61b.chunk.js +0 -2
- package/dist-scalprum/static/441.9f02e61b.chunk.js.map +0 -1
- package/dist-scalprum/static/5453.280127dd.chunk.js +0 -2
- package/dist-scalprum/static/5453.280127dd.chunk.js.map +0 -1
- package/dist-scalprum/static/5603.05d9ca7f.chunk.js +0 -2
- package/dist-scalprum/static/5603.05d9ca7f.chunk.js.map +0 -1
- package/dist-scalprum/static/6272.b5ee5195.chunk.js +0 -3
- package/dist-scalprum/static/6272.b5ee5195.chunk.js.LICENSE.txt +0 -9
- package/dist-scalprum/static/6272.b5ee5195.chunk.js.map +0 -1
- package/dist-scalprum/static/6371.c83dc422.chunk.js +0 -2
- package/dist-scalprum/static/6371.c83dc422.chunk.js.map +0 -1
- package/dist-scalprum/static/6422.97baf774.chunk.js +0 -2
- package/dist-scalprum/static/6422.97baf774.chunk.js.map +0 -1
- package/dist-scalprum/static/6800.736d5da3.chunk.js.map +0 -1
- package/dist-scalprum/static/6840.4728fab9.chunk.js.map +0 -1
- package/dist-scalprum/static/7556.aa8a002f.chunk.js.LICENSE.txt +0 -8
- package/dist-scalprum/static/7556.aa8a002f.chunk.js.map +0 -1
- package/dist-scalprum/static/7601.4df83556.chunk.js +0 -3
- package/dist-scalprum/static/7601.4df83556.chunk.js.LICENSE.txt +0 -9
- package/dist-scalprum/static/7601.4df83556.chunk.js.map +0 -1
- package/dist-scalprum/static/7791.12162a71.chunk.js +0 -2
- package/dist-scalprum/static/7791.12162a71.chunk.js.map +0 -1
- package/dist-scalprum/static/7984.c8511b89.chunk.js +0 -2
- package/dist-scalprum/static/7984.c8511b89.chunk.js.map +0 -1
- package/dist-scalprum/static/8365.d3360f18.chunk.js +0 -2
- package/dist-scalprum/static/8365.d3360f18.chunk.js.map +0 -1
- package/dist-scalprum/static/8563.7e068fb0.chunk.js.map +0 -1
- package/dist-scalprum/static/8799.7c749838.chunk.js +0 -2
- package/dist-scalprum/static/8799.7c749838.chunk.js.map +0 -1
- package/dist-scalprum/static/exposed-PluginRoot.a5792fb2.chunk.js +0 -2
- package/dist-scalprum/static/exposed-PluginRoot.a5792fb2.chunk.js.map +0 -1
- /package/dist-scalprum/static/{2928.4303c12e.chunk.js.LICENSE.txt → 1994.19e6a1c5.chunk.js.LICENSE.txt} +0 -0
- /package/dist-scalprum/static/{2628.6619bf8b.chunk.js.LICENSE.txt → 2628.0605e07f.chunk.js.LICENSE.txt} +0 -0
- /package/dist-scalprum/static/{5010.a4aa0f8e.chunk.js.LICENSE.txt → 5010.2228c754.chunk.js.LICENSE.txt} +0 -0
- /package/dist-scalprum/static/{1085.536aa0fa.chunk.js.LICENSE.txt → 6371.c4899d73.chunk.js.LICENSE.txt} +0 -0
- /package/dist-scalprum/static/{8563.7e068fb0.chunk.js.LICENSE.txt → 6763.d6cd937f.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkinternal_plugin_kuadrant=self.webpackChunkinternal_plugin_kuadrant||[]).push([[2752],{371:(e,t,n)=>{n.r(t),n.d(t,{AnalyticsContext:()=>u,FeatureFlagState:()=>c.FeatureFlagState,SessionState:()=>c.SessionState,alertApiRef:()=>c.alertApiRef,analyticsApiRef:()=>p,appThemeApiRef:()=>c.appThemeApiRef,atlassianAuthApiRef:()=>c.atlassianAuthApiRef,attachComponentData:()=>b,bitbucketAuthApiRef:()=>c.bitbucketAuthApiRef,bitbucketServerAuthApiRef:()=>c.bitbucketServerAuthApiRef,configApiRef:()=>c.configApiRef,createApiFactory:()=>c.createApiFactory,createApiRef:()=>c.createApiRef,createComponentExtension:()=>S,createExternalRouteRef:()=>z,createPlugin:()=>j,createReactExtension:()=>F,createRoutableExtension:()=>C,createRouteRef:()=>M,createSubRouteRef:()=>_,discoveryApiRef:()=>c.discoveryApiRef,errorApiRef:()=>c.errorApiRef,featureFlagsApiRef:()=>c.featureFlagsApiRef,fetchApiRef:()=>c.fetchApiRef,getComponentData:()=>y,githubAuthApiRef:()=>c.githubAuthApiRef,gitlabAuthApiRef:()=>c.gitlabAuthApiRef,googleAuthApiRef:()=>c.googleAuthApiRef,identityApiRef:()=>c.identityApiRef,microsoftAuthApiRef:()=>c.microsoftAuthApiRef,oauthRequestApiRef:()=>c.oauthRequestApiRef,oktaAuthApiRef:()=>c.oktaAuthApiRef,oneloginAuthApiRef:()=>c.oneloginAuthApiRef,openshiftAuthApiRef:()=>c.openshiftAuthApiRef,storageApiRef:()=>c.storageApiRef,useAnalytics:()=>d,useApi:()=>c.useApi,useApiHolder:()=>c.useApiHolder,useApp:()=>A,useElementFilter:()=>P,useRouteRef:()=>x,useRouteRefParams:()=>W,vmwareCloudAuthApiRef:()=>c.vmwareCloudAuthApiRef,withApis:()=>c.withApis});var r=n(31085),o=n(15427),i=n(95478);const a=(0,o.createVersionedContext)("analytics-context"),s=()=>{const e=(0,i.useContext)(a);if(void 0===e)return{routeRef:"unknown",pluginId:"root",extension:"App"};const t=e.atVersion(1);if(void 0===t)throw new Error("No context found for version 1.");return t},u=e=>{const{attributes:t,children:n}=e,i={...s(),...t},u=(0,o.createVersionedValueMap)({1:i});return(0,r.jsx)(a.Provider,{value:u,children:n})};var c=n(85762);const p=(0,c.createApiRef)({id:"core.analytics"}),l=(0,o.getOrCreateGlobalSingleton)("core-plugin-api:analytics-tracker-events",()=>({mostRecentGatheredNavigation:void 0,mostRecentRoutableExtensionRender:void 0,beforeUnloadRegistered:!1})),f="_ROUTABLE-EXTENSION-RENDERED";class h{analyticsApi;context;constructor(e,t={routeRef:"unknown",pluginId:"root",extension:"App"}){this.analyticsApi=e,this.context=t,l.beforeUnloadRegistered||(addEventListener("beforeunload",()=>{l.mostRecentGatheredNavigation&&(this.analyticsApi.captureEvent({...l.mostRecentGatheredNavigation,...l.mostRecentRoutableExtensionRender}),l.mostRecentGatheredNavigation=void 0,l.mostRecentRoutableExtensionRender=void 0)},{once:!0,passive:!0}),l.beforeUnloadRegistered=!0)}setContext(e){this.context=e}captureEvent(e,t,{value:n,attributes:r}={}){const{_routeNodeType:o,...i}=this.context;if(e!==f){if(l.mostRecentGatheredNavigation){try{this.analyticsApi.captureEvent({...l.mostRecentGatheredNavigation,...l.mostRecentRoutableExtensionRender})}catch(e){console.warn("Error during analytics event capture. %o",e)}l.mostRecentGatheredNavigation=void 0,l.mostRecentRoutableExtensionRender=void 0}if("navigate"!==e||"gathered"!==o||"root"!==i.pluginId)try{this.analyticsApi.captureEvent({action:e,subject:t,value:n,attributes:r,context:i})}catch(e){console.warn("Error during analytics event capture. %o",e)}else l.mostRecentGatheredNavigation={action:e,subject:t,value:n,attributes:r,context:i}}else l.mostRecentGatheredNavigation&&(l.mostRecentRoutableExtensionRender={context:{...i,extension:"App"}})}}function d(){const e=(0,i.useRef)(null),t=s(),n=function(){try{return(0,c.useApi)(p)}catch{return{captureEvent:()=>{}}}}(),r=(null===e.current&&(e.current=new h(n)),e.current);return r.setContext(t),r}const g=(0,o.getOrCreateGlobalSingleton)("legacy-plugin-compatibility-store",()=>new WeakMap);function R(e){let t=g.get(e);if(t)return t;const n=()=>{throw new Error("Not implemented in legacy plugin compatibility layer")};return t={getId:()=>e.id,get routes(){return{}},get externalRoutes(){return{}},getApis:n,getFeatureFlags:n,provide:n},g.set(e,t),t}function m(e){return(0,c.createFrontendPlugin)({pluginId:e.getId()})}const A=()=>{const e=function(){try{return(0,c.useApiHolder)()}catch{return}}(),t=e?.get(c.appTreeApiRef),n=e?.get(c.iconsApiRef),a=(0,o.useVersionedContext)("app-context"),s=(0,i.useMemo)(()=>{if(!t)return;if(!n)return;const{tree:e}=t.getTree();let o;const i=({plugin:e,...t})=>(0,r.jsx)(c.ErrorDisplay,{...t,plugin:e&&m(e)});return{getPlugins(){if(o)return o;const t=new Set;for(const n of e.nodes.values()){const e=n.spec.plugin;e&&t.add(R(e))}return o=Array.from(t),o},getSystemIcon:e=>n.getIcon(e),getSystemIcons:()=>Object.fromEntries(n.listIconKeys().map(e=>[e,n.getIcon(e)])),getComponents:()=>({NotFoundErrorPage:c.NotFoundErrorPage,BootErrorPage(){throw new Error("The BootErrorPage app component should not be accessed by plugins")},Progress:c.Progress,Router(){throw new Error("The Router app component should not be accessed by plugins")},ErrorBoundaryFallback:i})}},[t,n]);if(s)return s;if(!a)throw new Error("App context is not available");const u=a.atVersion(1);if(!u)throw new Error("AppContext v1 not available");return u},v=(0,o.getOrCreateGlobalSingleton)("component-data-store",()=>new WeakMap),w="__backstage_data";function b(e,t,n){const r=e;let o=r[w]??v.get(e);if(o||(o={map:new Map},Object.defineProperty(r,w,{enumerable:!1,configurable:!0,writable:!1,value:o}),v.set(e,o)),o.map.has(t)){const n=e.displayName||e.name;throw new Error(`Attempted to attach duplicate data "${t}" to component "${n}"`)}o.map.set(t,n)}function y(e,t){if(!e)return;const n=e.type;if(!n)return;const r=n[w]??v.get(n);return r?r.map.get(t):void 0}var E=n(49634);function x(e){const{pathname:t}=(0,E.useLocation)(),n=function(){try{return(0,c.useApi)(c.routeResolutionApiRef)}catch{return}}(),r=(0,o.useVersionedContext)("routing-context"),a=r?.atVersion(1),s=(0,i.useMemo)(()=>{if(!n)return null;try{return n?.resolve(e,{sourcePath:t})}catch{return null}},[n,e,t]),u=(0,i.useMemo)(()=>a&&a.resolve(e,{pathname:t}),[a,e,t]);if(null!==s){const t="optional"in e&&e.optional;if(!s&&!t)throw new Error(`No path for ${e}`);return s}if(!r)throw new Error("Routing context is not available");if(!a)throw new Error("RoutingContext v1 not available");const p="optional"in e&&e.optional;if(!u&&!p)throw new Error(`No path for ${e}`);return u}class I extends i.Component{static getDerivedStateFromError(e){return{error:e}}state={error:void 0};handleErrorReset=()=>{this.setState({error:void 0})};render(){const{error:e}=this.state,{app:t,plugin:n}=this.props,{ErrorBoundaryFallback:o}=t.getComponents();return e?(0,r.jsx)(o,{error:e,resetError:this.handleErrorReset,plugin:n}):this.props.children}}var $=n(57556);function C(e){const{component:t,mountPoint:n,name:o}=e;return F({component:{lazy:()=>t().then(e=>{const t=t=>{const o=d();try{x(n)}catch(e){if("object"==typeof e&&null!==e){const{message:t}=e;if("string"==typeof t&&t.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${n} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw e}return(0,i.useEffect)(()=>{o.captureEvent(f,"")},[o]),(0,r.jsx)(e,{...t})},a=o||e.displayName||e.name||"LazyComponent";return t.displayName=`RoutableExtension(${a})`,t})},data:{"core.mountPoint":n},name:o})}function S(e){const{component:t,name:n}=e;return F({component:t,name:n})}function F(e){const{data:t={},name:n}=e;let o;if(n||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name."),"lazy"in e.component){const t=e.component.lazy;o=(0,i.lazy)(()=>t().then(e=>({default:e}),e=>{const t=n?` of the ${n} extension`:"";throw new $.HK(`Failed lazy loading${t}, try to reload the page`,e)}))}else o=e.component.sync;const a=n||o.displayName||o.name||"Component";return{expose(e){const s=a=>{const s=A(),{Progress:c}=s.getComponents(),p=t?.["core.mountPoint"];return(0,r.jsx)(i.Suspense,{fallback:(0,r.jsx)(c,{}),children:(0,r.jsx)(I,{app:s,plugin:e,children:(0,r.jsx)(u,{attributes:{pluginId:e.getId(),...n&&{extension:n},...p&&{routeRef:p.id}},children:(0,r.jsx)(o,{...a})})})})};b(s,"core.plugin",e),b(s,"core.extensionName",n);for(const[e,n]of Object.entries(t))b(s,e,n);return s.displayName=`Extension(${a})`,s}}}function k(e,t,n,r){return i.Children.toArray(e).flatMap(e=>{if(!(0,i.isValidElement)(e))return[];if(e.type===i.Fragment)return k(e.props.children,t,n,r);if(y(e,"core.featureFlagged")){const o=e.props;return("with"in o?t.isActive(o.with):!t.isActive(o.without))?k(e.props.children,t,n,r):[]}if(void 0===n||n(e))return[e];if(r)throw new Error(r);return k(e.props.children,t,n,r)})}class N{node;featureFlagsApi;constructor(e,t){this.node=e,this.featureFlagsApi=t}selectByComponentData(e){const t=k(this.node,this.featureFlagsApi,t=>void 0!==y(t,e.key),e.withStrictError);return new N(t,this.featureFlagsApi)}findComponentData(e){return k(this.node,this.featureFlagsApi,t=>void 0!==y(t,e.key)).map(t=>y(t,e.key)).filter(e=>void 0!==e)}getElements(){return k(this.node,this.featureFlagsApi)}}function P(e,t,n=[]){const r=(0,c.useApi)(c.featureFlagsApiRef),o=new N(e,r);return(0,i.useMemo)(()=>t(o),[e,...n])}class T{constructor(e){this.config=e}getId(){return this.config.id}getApis(){return this.config.apis??[]}getFeatureFlags(){return this.config.featureFlags?.slice()??[]}get routes(){return this.config.routes??{}}get externalRoutes(){return this.config.externalRoutes??{}}provide(e){return e.expose(this)}toString(){return`plugin{${this.config.id}}`}}function j(e){return new T(e)}const D=(0,o.getOrCreateGlobalSingleton)("route-ref-type",()=>Symbol("route-ref-type"));class G{[D]="absolute";id;params;constructor(e,t){this.id=e,this.params=t}get title(){return this.id}toString(){return this.#e?`routeRef{id=${this.#e},legacyId=${this.id}}`:`routeRef{type=absolute,id=${this.id}}`}$$type="@backstage/RouteRef";version="v1";T=void 0;alias=void 0;#e=void 0;getParams(){return this.params}getDescription(){return this.#e?this.#e:this.id}setId(e){if(!e)throw new Error("RouteRef id must be a non-empty string");if(this.#e&&this.#e!==e)throw new Error(`RouteRef was referenced twice as both '${this.#e}' and '${e}'`);this.#e=e}}function M(e){return new G(e.id,e.params??[])}const O=/^\w+$/;class V{[D]="sub";id;path;parent;params;constructor(e,t,n,r){this.id=e,this.path=t,this.parent=n,this.params=r}toString(){return`routeRef{type=sub,id=${this.id}}`}$$type="@backstage/SubRouteRef";version="v1";T=void 0;getParams(){return this.params}getParent(){return this.parent}getDescription(){return`at ${this.path} with parent ${this.parent}`}}function _(e){const{id:t,path:n,parent:r}=e,o=n.split("/").filter(e=>e.startsWith(":")).map(e=>e.substring(1)),i=[...r.params,...o];if(r.params.some(e=>o.includes(e)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!n.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${n}'`);if(n.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${n}'`);for(const e of o)if(!O.test(e))throw new Error(`SubRouteRef path has invalid param, got '${e}'`);return new V(t,n,r,i)}class B{[D]="external";id;params;optional;defaultTarget;constructor(e,t,n,r){this.id=e,this.params=t,this.optional=n,this.defaultTarget=r}toString(){return this.#e?`externalRouteRef{id=${this.#e},legacyId=${this.id}}`:`routeRef{type=external,id=${this.id}}`}getDefaultTarget(){return this.defaultTarget}$$type="@backstage/ExternalRouteRef";version="v1";T=void 0;#e=void 0;getParams(){return this.params}getDescription(){return this.#e?this.#e:this.id}setId(e){if(!e)throw new Error("ExternalRouteRef id must be a non-empty string");if(this.#e&&this.#e!==e)throw new Error(`ExternalRouteRef was referenced twice as both '${this.#e}' and '${e}'`);this.#e=e}}function z(e){return new B(e.id,e.params??[],Boolean(e.optional),e?.defaultTarget)}function W(e){return(0,E.useParams)()}}}]);
|
|
2
|
+
//# sourceMappingURL=2752.df63f31c.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/2752.df63f31c.chunk.js","mappings":"slDAIA,MAAMA,GAAwB,IAAAC,wBAAuB,qBAC/CC,EAAsB,KAC1B,MAAMC,GAAa,IAAAC,YAAWJ,GAC9B,QAAmB,IAAfG,EACF,MAAO,CACLE,SAAU,UACVC,SAAU,OACVC,UAAW,OAGf,MAAMC,EAAWL,EAAWM,UAAU,GACtC,QAAiB,IAAbD,EACF,MAAM,IAAIE,MAAM,mCAElB,OAAOF,GAEHG,EAAoBC,IACxB,MAAM,WAAEC,EAAU,SAAEC,GAAaF,EAE3BG,EAAgB,IADDb,OAGhBW,GAECG,GAAyB,IAAAC,yBAAwB,CAAE,EAAGF,IAC5D,OAAuB,IAAAG,KAAIlB,EAAsBmB,SAAU,CAAEC,MAAOJ,EAAwBF,c,eC1B9F,MAAMO,GAAkB,IAAAC,cAAa,CACnCC,GAAI,mBCDAC,GAAe,IAAAC,4BACnB,2CACA,KAAM,CACJC,kCAA8B,EAC9BC,uCAAmC,EACnCC,wBAAwB,KAGtBC,EAAiC,+BACvC,MAAMC,EACJC,aACAC,QACA,WAAAC,CAAYF,EAAcC,EAAU,CAClC3B,SAAU,UACVC,SAAU,OACVC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ACjC,MAAM,IAAInN,MACR,kDAAkDwB,MAAK,WAAgB2L,MAG3E3L,MAAK,EAAS2L,CAChB,EAEF,SAASoB,EAAuBrO,GAC9B,OAAO,IAAIkO,EACTlO,EAAQW,GACRX,EAAQwM,QAAU,GAClB8B,QAAQtO,EAAQiI,UAChBjI,GAASmO,cAEb,CCtDA,SAASI,EAAkBC,GACzB,OAAO,IAAAC,YACT,C","sources":["webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/analytics/AnalyticsContext.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/apis/definitions/AnalyticsApi.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/analytics/Tracker.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/analytics/useAnalytics.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/app/useApp.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/extensions/componentData.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/routing/useRouteRef.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/extensions/PluginErrorBoundary.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/extensions/extensions.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/extensions/useElementFilter.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/plugin/Plugin.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/routing/types.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/routing/RouteRef.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/routing/SubRouteRef.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/routing/ExternalRouteRef.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/plugin-catalog/node_modules/@backstage/core-plugin-api/dist/routing/useRouteRefParams.esm.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { createVersionedContext, createVersionedValueMap } from '@backstage/version-bridge';\nimport { useContext } from 'react';\n\nconst AnalyticsReactContext = createVersionedContext(\"analytics-context\");\nconst useAnalyticsContext = () => {\n const theContext = useContext(AnalyticsReactContext);\n if (theContext === void 0) {\n return {\n routeRef: \"unknown\",\n pluginId: \"root\",\n extension: \"App\"\n };\n }\n const theValue = theContext.atVersion(1);\n if (theValue === void 0) {\n throw new Error(\"No context found for version 1.\");\n }\n return theValue;\n};\nconst AnalyticsContext = (options) => {\n const { attributes, children } = options;\n const parentValues = useAnalyticsContext();\n const combinedValue = {\n ...parentValues,\n ...attributes\n };\n const versionedCombinedValue = createVersionedValueMap({ 1: combinedValue });\n return /* @__PURE__ */ jsx(AnalyticsReactContext.Provider, { value: versionedCombinedValue, children });\n};\n\nexport { AnalyticsContext, useAnalyticsContext };\n//# sourceMappingURL=AnalyticsContext.esm.js.map\n","import { createApiRef } from '@backstage/frontend-plugin-api';\n\nconst analyticsApiRef = createApiRef({\n id: \"core.analytics\"\n});\n\nexport { analyticsApiRef };\n//# sourceMappingURL=AnalyticsApi.esm.js.map\n","import { getOrCreateGlobalSingleton } from '@backstage/version-bridge';\n\nconst globalEvents = getOrCreateGlobalSingleton(\n \"core-plugin-api:analytics-tracker-events\",\n () => ({\n mostRecentGatheredNavigation: void 0,\n mostRecentRoutableExtensionRender: void 0,\n beforeUnloadRegistered: false\n })\n);\nconst routableExtensionRenderedEvent = \"_ROUTABLE-EXTENSION-RENDERED\";\nclass Tracker {\n analyticsApi;\n context;\n constructor(analyticsApi, context = {\n routeRef: \"unknown\",\n pluginId: \"root\",\n extension: \"App\"\n }) {\n this.analyticsApi = analyticsApi;\n this.context = context;\n if (!globalEvents.beforeUnloadRegistered) {\n addEventListener(\n \"beforeunload\",\n () => {\n if (globalEvents.mostRecentGatheredNavigation) {\n this.analyticsApi.captureEvent({\n ...globalEvents.mostRecentGatheredNavigation,\n ...globalEvents.mostRecentRoutableExtensionRender\n });\n globalEvents.mostRecentGatheredNavigation = void 0;\n globalEvents.mostRecentRoutableExtensionRender = void 0;\n }\n },\n { once: true, passive: true }\n );\n globalEvents.beforeUnloadRegistered = true;\n }\n }\n setContext(context) {\n this.context = context;\n }\n captureEvent(action, subject, {\n value,\n attributes\n } = {}) {\n const { _routeNodeType, ...context } = this.context;\n if (action === routableExtensionRenderedEvent) {\n if (globalEvents.mostRecentGatheredNavigation) {\n globalEvents.mostRecentRoutableExtensionRender = {\n context: {\n ...context,\n extension: \"App\"\n }\n };\n }\n return;\n }\n if (globalEvents.mostRecentGatheredNavigation) {\n try {\n this.analyticsApi.captureEvent({\n ...globalEvents.mostRecentGatheredNavigation,\n ...globalEvents.mostRecentRoutableExtensionRender\n });\n } catch (e) {\n console.warn(\"Error during analytics event capture. %o\", e);\n }\n globalEvents.mostRecentGatheredNavigation = void 0;\n globalEvents.mostRecentRoutableExtensionRender = void 0;\n }\n if (action === \"navigate\" && _routeNodeType === \"gathered\" && context.pluginId === \"root\") {\n globalEvents.mostRecentGatheredNavigation = {\n action,\n subject,\n value,\n attributes,\n context\n };\n return;\n }\n try {\n this.analyticsApi.captureEvent({\n action,\n subject,\n value,\n attributes,\n context\n });\n } catch (e) {\n console.warn(\"Error during analytics event capture. %o\", e);\n }\n }\n}\n\nexport { Tracker, routableExtensionRenderedEvent };\n//# sourceMappingURL=Tracker.esm.js.map\n","import { useAnalyticsContext } from './AnalyticsContext.esm.js';\nimport { useApi } from '@backstage/frontend-plugin-api';\nimport { analyticsApiRef } from '../apis/definitions/AnalyticsApi.esm.js';\nimport { useRef } from 'react';\nimport { Tracker } from './Tracker.esm.js';\n\nfunction useAnalyticsApi() {\n try {\n return useApi(analyticsApiRef);\n } catch {\n return { captureEvent: () => {\n } };\n }\n}\nfunction useAnalytics() {\n const trackerRef = useRef(null);\n const context = useAnalyticsContext();\n const analyticsApi = useAnalyticsApi();\n function getTracker() {\n if (trackerRef.current === null) {\n trackerRef.current = new Tracker(analyticsApi);\n }\n return trackerRef.current;\n }\n const tracker = getTracker();\n tracker.setContext(context);\n return tracker;\n}\n\nexport { useAnalytics };\n//# sourceMappingURL=useAnalytics.esm.js.map\n","import { jsx } from 'react/jsx-runtime';\nimport { useMemo } from 'react';\nimport { getOrCreateGlobalSingleton, useVersionedContext } from '@backstage/version-bridge';\nimport { appTreeApiRef, iconsApiRef, Progress, NotFoundErrorPage, useApiHolder, ErrorDisplay, createFrontendPlugin } from '@backstage/frontend-plugin-api';\n\nconst legacyPluginStore = getOrCreateGlobalSingleton(\n \"legacy-plugin-compatibility-store\",\n () => /* @__PURE__ */ new WeakMap()\n);\nfunction toLegacyPlugin(plugin) {\n let legacy = legacyPluginStore.get(plugin);\n if (legacy) {\n return legacy;\n }\n const errorMsg = \"Not implemented in legacy plugin compatibility layer\";\n const notImplemented = () => {\n throw new Error(errorMsg);\n };\n legacy = {\n getId() {\n return plugin.id;\n },\n get routes() {\n return {};\n },\n get externalRoutes() {\n return {};\n },\n getApis: notImplemented,\n getFeatureFlags: notImplemented,\n provide: notImplemented\n };\n legacyPluginStore.set(plugin, legacy);\n return legacy;\n}\nfunction toNewPlugin(plugin) {\n return createFrontendPlugin({\n pluginId: plugin.getId()\n });\n}\nfunction useOptionalApiHolder() {\n try {\n return useApiHolder();\n } catch {\n return void 0;\n }\n}\nconst useApp = () => {\n const apiHolder = useOptionalApiHolder();\n const appTreeApi = apiHolder?.get(appTreeApiRef);\n const iconsApi = apiHolder?.get(iconsApiRef);\n const versionedContext = useVersionedContext(\n \"app-context\"\n );\n const newAppContext = useMemo(() => {\n if (!appTreeApi) {\n return void 0;\n }\n if (!iconsApi) {\n return void 0;\n }\n const { tree } = appTreeApi.getTree();\n let gatheredPlugins = void 0;\n const ErrorBoundaryFallbackWrapper = ({ plugin, ...rest }) => /* @__PURE__ */ jsx(ErrorDisplay, { ...rest, plugin: plugin && toNewPlugin(plugin) });\n return {\n getPlugins() {\n if (gatheredPlugins) {\n return gatheredPlugins;\n }\n const pluginSet = /* @__PURE__ */ new Set();\n for (const node of tree.nodes.values()) {\n const plugin = node.spec.plugin;\n if (plugin) {\n pluginSet.add(toLegacyPlugin(plugin));\n }\n }\n gatheredPlugins = Array.from(pluginSet);\n return gatheredPlugins;\n },\n getSystemIcon(key) {\n return iconsApi.getIcon(key);\n },\n getSystemIcons() {\n return Object.fromEntries(\n iconsApi.listIconKeys().map((key) => [key, iconsApi.getIcon(key)])\n );\n },\n getComponents() {\n return {\n NotFoundErrorPage,\n BootErrorPage() {\n throw new Error(\n \"The BootErrorPage app component should not be accessed by plugins\"\n );\n },\n Progress,\n Router() {\n throw new Error(\n \"The Router app component should not be accessed by plugins\"\n );\n },\n ErrorBoundaryFallback: ErrorBoundaryFallbackWrapper\n };\n }\n };\n }, [appTreeApi, iconsApi]);\n if (newAppContext) {\n return newAppContext;\n }\n if (!versionedContext) {\n throw new Error(\"App context is not available\");\n }\n const appContext = versionedContext.atVersion(1);\n if (!appContext) {\n throw new Error(\"AppContext v1 not available\");\n }\n return appContext;\n};\n\nexport { useApp };\n//# sourceMappingURL=useApp.esm.js.map\n","import { getOrCreateGlobalSingleton } from '@backstage/version-bridge';\n\nconst globalStore = getOrCreateGlobalSingleton(\n \"component-data-store\",\n () => /* @__PURE__ */ new WeakMap()\n);\nconst componentDataKey = \"__backstage_data\";\nfunction attachComponentData(component, type, data) {\n const dataComponent = component;\n let container = dataComponent[componentDataKey] ?? globalStore.get(component);\n if (!container) {\n container = { map: /* @__PURE__ */ new Map() };\n Object.defineProperty(dataComponent, componentDataKey, {\n enumerable: false,\n configurable: true,\n writable: false,\n value: container\n });\n globalStore.set(component, container);\n }\n if (container.map.has(type)) {\n const name = component.displayName || component.name;\n throw new Error(\n `Attempted to attach duplicate data \"${type}\" to component \"${name}\"`\n );\n }\n container.map.set(type, data);\n}\nfunction getComponentData(node, type) {\n if (!node) {\n return void 0;\n }\n const component = node.type;\n if (!component) {\n return void 0;\n }\n const container = component[componentDataKey] ?? globalStore.get(component);\n if (!container) {\n return void 0;\n }\n return container.map.get(type);\n}\n\nexport { attachComponentData, getComponentData };\n//# sourceMappingURL=componentData.esm.js.map\n","import { useMemo } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { useVersionedContext } from '@backstage/version-bridge';\nimport { useApi, routeResolutionApiRef } from '@backstage/frontend-plugin-api';\n\nfunction useRouteResolutionApi() {\n try {\n return useApi(routeResolutionApiRef);\n } catch {\n return void 0;\n }\n}\nfunction useRouteRef(routeRef) {\n const { pathname } = useLocation();\n const routeResolutionApi = useRouteResolutionApi();\n const versionedContext = useVersionedContext(\n \"routing-context\"\n );\n const resolver = versionedContext?.atVersion(1);\n const newRouteFunc = useMemo(() => {\n if (!routeResolutionApi) {\n return null;\n }\n try {\n return routeResolutionApi?.resolve(routeRef, {\n sourcePath: pathname\n });\n } catch {\n return null;\n }\n }, [routeResolutionApi, routeRef, pathname]);\n const legacyRouteFunc = useMemo(\n () => resolver && resolver.resolve(routeRef, { pathname }),\n [resolver, routeRef, pathname]\n );\n if (newRouteFunc !== null) {\n const isOptional2 = \"optional\" in routeRef && routeRef.optional;\n if (!newRouteFunc && !isOptional2) {\n throw new Error(`No path for ${routeRef}`);\n }\n return newRouteFunc;\n }\n if (!versionedContext) {\n throw new Error(\"Routing context is not available\");\n }\n if (!resolver) {\n throw new Error(\"RoutingContext v1 not available\");\n }\n const isOptional = \"optional\" in routeRef && routeRef.optional;\n if (!legacyRouteFunc && !isOptional) {\n throw new Error(`No path for ${routeRef}`);\n }\n return legacyRouteFunc;\n}\n\nexport { useRouteRef };\n//# sourceMappingURL=useRouteRef.esm.js.map\n","import { jsx } from 'react/jsx-runtime';\nimport { Component } from 'react';\n\nclass PluginErrorBoundary extends Component {\n static getDerivedStateFromError(error) {\n return { error };\n }\n state = { error: void 0 };\n handleErrorReset = () => {\n this.setState({ error: void 0 });\n };\n render() {\n const { error } = this.state;\n const { app, plugin } = this.props;\n const { ErrorBoundaryFallback } = app.getComponents();\n if (error) {\n return /* @__PURE__ */ jsx(\n ErrorBoundaryFallback,\n {\n error,\n resetError: this.handleErrorReset,\n plugin\n }\n );\n }\n return this.props.children;\n }\n}\n\nexport { PluginErrorBoundary };\n//# sourceMappingURL=PluginErrorBoundary.esm.js.map\n","import { jsx } from 'react/jsx-runtime';\nimport { lazy, useEffect, Suspense } from 'react';\nimport { AnalyticsContext } from '../analytics/AnalyticsContext.esm.js';\nimport { useAnalytics } from '../analytics/useAnalytics.esm.js';\nimport { useApp } from '../app/useApp.esm.js';\nimport '../routing/types.esm.js';\nimport { useRouteRef } from '../routing/useRouteRef.esm.js';\nimport 'react-router-dom';\nimport { attachComponentData } from './componentData.esm.js';\nimport { PluginErrorBoundary } from './PluginErrorBoundary.esm.js';\nimport { routableExtensionRenderedEvent } from '../analytics/Tracker.esm.js';\nimport { ForwardedError } from '@backstage/errors';\n\nfunction createRoutableExtension(options) {\n const { component, mountPoint, name } = options;\n return createReactExtension({\n component: {\n lazy: () => component().then((InnerComponent) => {\n const RoutableExtensionWrapper = (props) => {\n const analytics = useAnalytics();\n try {\n useRouteRef(mountPoint);\n } catch (error) {\n if (typeof error === \"object\" && error !== null) {\n const { message } = error;\n if (typeof message === \"string\" && message.startsWith(\"No path for \")) {\n throw new Error(\n `Routable extension component with mount point ${mountPoint} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`\n );\n }\n }\n throw error;\n }\n useEffect(() => {\n analytics.captureEvent(routableExtensionRenderedEvent, \"\");\n }, [analytics]);\n return /* @__PURE__ */ jsx(InnerComponent, { ...props });\n };\n const componentName = name || InnerComponent.displayName || InnerComponent.name || \"LazyComponent\";\n RoutableExtensionWrapper.displayName = `RoutableExtension(${componentName})`;\n return RoutableExtensionWrapper;\n })\n },\n data: {\n \"core.mountPoint\": mountPoint\n },\n name\n });\n}\nfunction createComponentExtension(options) {\n const { component, name } = options;\n return createReactExtension({ component, name });\n}\nfunction createReactExtension(options) {\n const { data = {}, name } = options;\n if (!name) {\n console.warn(\n \"Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.\"\n );\n }\n let Component;\n if (\"lazy\" in options.component) {\n const lazyLoader = options.component.lazy;\n Component = lazy(\n () => lazyLoader().then(\n (component) => ({ default: component }),\n (error) => {\n const ofExtension = name ? ` of the ${name} extension` : \"\";\n throw new ForwardedError(\n `Failed lazy loading${ofExtension}, try to reload the page`,\n error\n );\n }\n )\n );\n } else {\n Component = options.component.sync;\n }\n const componentName = name || Component.displayName || Component.name || \"Component\";\n return {\n expose(plugin) {\n const Result = (props) => {\n const app = useApp();\n const { Progress } = app.getComponents();\n const mountPoint = data?.[\"core.mountPoint\"];\n return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Progress, {}), children: /* @__PURE__ */ jsx(PluginErrorBoundary, { app, plugin, children: /* @__PURE__ */ jsx(\n AnalyticsContext,\n {\n attributes: {\n pluginId: plugin.getId(),\n ...name && { extension: name },\n ...mountPoint && { routeRef: mountPoint.id }\n },\n children: /* @__PURE__ */ jsx(Component, { ...props })\n }\n ) }) });\n };\n attachComponentData(Result, \"core.plugin\", plugin);\n attachComponentData(Result, \"core.extensionName\", name);\n for (const [key, value] of Object.entries(data)) {\n attachComponentData(Result, key, value);\n }\n Result.displayName = `Extension(${componentName})`;\n return Result;\n }\n };\n}\n\nexport { createComponentExtension, createReactExtension, createRoutableExtension };\n//# sourceMappingURL=extensions.esm.js.map\n","import { useMemo, Children, isValidElement, Fragment } from 'react';\nimport { getComponentData } from './componentData.esm.js';\nimport { useApi, featureFlagsApiRef } from '@backstage/frontend-plugin-api';\nimport '../apis/definitions/AnalyticsApi.esm.js';\n\nfunction selectChildren(rootNode, featureFlagsApi, selector, strictError) {\n return Children.toArray(rootNode).flatMap((node) => {\n if (!isValidElement(node)) {\n return [];\n }\n if (node.type === Fragment) {\n return selectChildren(\n node.props.children,\n featureFlagsApi,\n selector,\n strictError\n );\n }\n if (getComponentData(node, \"core.featureFlagged\")) {\n const props = node.props;\n const isEnabled = \"with\" in props ? featureFlagsApi.isActive(props.with) : !featureFlagsApi.isActive(props.without);\n if (isEnabled) {\n return selectChildren(\n node.props.children,\n featureFlagsApi,\n selector,\n strictError\n );\n }\n return [];\n }\n if (selector === void 0 || selector(node)) {\n return [node];\n }\n if (strictError) {\n throw new Error(strictError);\n }\n return selectChildren(\n node.props.children,\n featureFlagsApi,\n selector,\n strictError\n );\n });\n}\nclass Collection {\n node;\n featureFlagsApi;\n constructor(node, featureFlagsApi) {\n this.node = node;\n this.featureFlagsApi = featureFlagsApi;\n }\n selectByComponentData(query) {\n const selection = selectChildren(\n this.node,\n this.featureFlagsApi,\n (node) => getComponentData(node, query.key) !== void 0,\n query.withStrictError\n );\n return new Collection(selection, this.featureFlagsApi);\n }\n findComponentData(query) {\n const selection = selectChildren(\n this.node,\n this.featureFlagsApi,\n (node) => getComponentData(node, query.key) !== void 0\n );\n return selection.map((node) => getComponentData(node, query.key)).filter((data) => data !== void 0);\n }\n getElements() {\n return selectChildren(this.node, this.featureFlagsApi);\n }\n}\nfunction useElementFilter(node, filterFn, dependencies = []) {\n const featureFlagsApi = useApi(featureFlagsApiRef);\n const elements = new Collection(node, featureFlagsApi);\n return useMemo(() => filterFn(elements), [node, ...dependencies]);\n}\n\nexport { useElementFilter };\n//# sourceMappingURL=useElementFilter.esm.js.map\n","class PluginImpl {\n constructor(config) {\n this.config = config;\n }\n getId() {\n return this.config.id;\n }\n getApis() {\n return this.config.apis ?? [];\n }\n getFeatureFlags() {\n return this.config.featureFlags?.slice() ?? [];\n }\n get routes() {\n return this.config.routes ?? {};\n }\n get externalRoutes() {\n return this.config.externalRoutes ?? {};\n }\n provide(extension) {\n return extension.expose(this);\n }\n toString() {\n return `plugin{${this.config.id}}`;\n }\n}\nfunction createPlugin(config) {\n return new PluginImpl(config);\n}\n\nexport { PluginImpl, createPlugin };\n//# sourceMappingURL=Plugin.esm.js.map\n","import { getOrCreateGlobalSingleton } from '@backstage/version-bridge';\n\nconst routeRefType = getOrCreateGlobalSingleton(\n \"route-ref-type\",\n () => /* @__PURE__ */ Symbol(\"route-ref-type\")\n);\n\nexport { routeRefType };\n//# sourceMappingURL=types.esm.js.map\n","import { routeRefType } from './types.esm.js';\n\nclass RouteRefImpl {\n [routeRefType] = \"absolute\";\n id;\n params;\n constructor(id, params) {\n this.id = id;\n this.params = params;\n }\n get title() {\n return this.id;\n }\n toString() {\n if (this.#nfsId) {\n return `routeRef{id=${this.#nfsId},legacyId=${this.id}}`;\n }\n return `routeRef{type=absolute,id=${this.id}}`;\n }\n // NFS implementation below\n $$type = \"@backstage/RouteRef\";\n version = \"v1\";\n T = void 0;\n alias = void 0;\n #nfsId = void 0;\n getParams() {\n return this.params;\n }\n getDescription() {\n if (this.#nfsId) {\n return this.#nfsId;\n }\n return this.id;\n }\n setId(newId) {\n if (!newId) {\n throw new Error(`RouteRef id must be a non-empty string`);\n }\n if (this.#nfsId && this.#nfsId !== newId) {\n throw new Error(\n `RouteRef was referenced twice as both '${this.#nfsId}' and '${newId}'`\n );\n }\n this.#nfsId = newId;\n }\n}\nfunction createRouteRef(config) {\n return new RouteRefImpl(\n config.id,\n config.params ?? []\n );\n}\n\nexport { RouteRefImpl, createRouteRef };\n//# sourceMappingURL=RouteRef.esm.js.map\n","import { routeRefType } from './types.esm.js';\n\nconst PARAM_PATTERN = /^\\w+$/;\nclass SubRouteRefImpl {\n [routeRefType] = \"sub\";\n id;\n path;\n parent;\n params;\n constructor(id, path, parent, params) {\n this.id = id;\n this.path = path;\n this.parent = parent;\n this.params = params;\n }\n toString() {\n return `routeRef{type=sub,id=${this.id}}`;\n }\n // NFS implementation below\n $$type = \"@backstage/SubRouteRef\";\n version = \"v1\";\n T = void 0;\n getParams() {\n return this.params;\n }\n getParent() {\n return this.parent;\n }\n getDescription() {\n return `at ${this.path} with parent ${this.parent}`;\n }\n}\nfunction createSubRouteRef(config) {\n const { id, path, parent } = config;\n const pathParams = path.split(\"/\").filter((p) => p.startsWith(\":\")).map((p) => p.substring(1));\n const params = [...parent.params, ...pathParams];\n if (parent.params.some((p) => pathParams.includes(p))) {\n throw new Error(\n \"SubRouteRef may not have params that overlap with its parent\"\n );\n }\n if (!path.startsWith(\"/\")) {\n throw new Error(`SubRouteRef path must start with '/', got '${path}'`);\n }\n if (path.endsWith(\"/\")) {\n throw new Error(`SubRouteRef path must not end with '/', got '${path}'`);\n }\n for (const param of pathParams) {\n if (!PARAM_PATTERN.test(param)) {\n throw new Error(`SubRouteRef path has invalid param, got '${param}'`);\n }\n }\n const subRouteRef = new SubRouteRefImpl(\n id,\n path,\n parent,\n params\n );\n return subRouteRef;\n}\n\nexport { SubRouteRefImpl, createSubRouteRef };\n//# sourceMappingURL=SubRouteRef.esm.js.map\n","import { routeRefType } from './types.esm.js';\n\nclass ExternalRouteRefImpl {\n [routeRefType] = \"external\";\n id;\n params;\n optional;\n defaultTarget;\n constructor(id, params, optional, defaultTarget) {\n this.id = id;\n this.params = params;\n this.optional = optional;\n this.defaultTarget = defaultTarget;\n }\n toString() {\n if (this.#nfsId) {\n return `externalRouteRef{id=${this.#nfsId},legacyId=${this.id}}`;\n }\n return `routeRef{type=external,id=${this.id}}`;\n }\n getDefaultTarget() {\n return this.defaultTarget;\n }\n // NFS implementation below\n $$type = \"@backstage/ExternalRouteRef\";\n version = \"v1\";\n T = void 0;\n #nfsId = void 0;\n getParams() {\n return this.params;\n }\n getDescription() {\n if (this.#nfsId) {\n return this.#nfsId;\n }\n return this.id;\n }\n setId(newId) {\n if (!newId) {\n throw new Error(`ExternalRouteRef id must be a non-empty string`);\n }\n if (this.#nfsId && this.#nfsId !== newId) {\n throw new Error(\n `ExternalRouteRef was referenced twice as both '${this.#nfsId}' and '${newId}'`\n );\n }\n this.#nfsId = newId;\n }\n}\nfunction createExternalRouteRef(options) {\n return new ExternalRouteRefImpl(\n options.id,\n options.params ?? [],\n Boolean(options.optional),\n options?.defaultTarget\n );\n}\n\nexport { ExternalRouteRefImpl, createExternalRouteRef };\n//# sourceMappingURL=ExternalRouteRef.esm.js.map\n","import { useParams } from 'react-router-dom';\n\nfunction useRouteRefParams(_routeRef) {\n return useParams();\n}\n\nexport { useRouteRefParams };\n//# sourceMappingURL=useRouteRefParams.esm.js.map\n"],"names":["AnalyticsReactContext","createVersionedContext","useAnalyticsContext","theContext","useContext","routeRef","pluginId","extension","theValue","atVersion","Error","AnalyticsContext","options","attributes","children","combinedValue","versionedCombinedValue","createVersionedValueMap","jsx","Provider","value","analyticsApiRef","createApiRef","id","globalEvents","getOrCreateGlobalSingleton","mostRecentGatheredNavigation","mostRecentRoutableExtensionRender","beforeUnloadRegistered","routableExtensionRenderedEvent","Tracker","analyticsApi","context","constructor","this","addEventListener","captureEvent","once","passive","setContext","action","subject","_routeNodeType","e","console","warn","useAnalytics","trackerRef","useRef","useApi","useAnalyticsApi","tracker","current","legacyPluginStore","WeakMap","toLegacyPlugin","plugin","legacy","get","notImplemented","getId","routes","externalRoutes","getApis","getFeatureFlags","provide","set","toNewPlugin","createFrontendPlugin","useApp","apiHolder","useApiHolder","useOptionalApiHolder","appTreeApi","appTreeApiRef","iconsApi","iconsApiRef","versionedContext","useVersionedContext","newAppContext","useMemo","tree","getTree","gatheredPlugins","ErrorBoundaryFallbackWrapper","rest","ErrorDisplay","getPlugins","pluginSet","Set","node","nodes","values","spec","add","Array","from","getSystemIcon","key","getIcon","getSystemIcons","Object","fromEntries","listIconKeys","map","getComponents","NotFoundErrorPage","BootErrorPage","Progress","Router","ErrorBoundaryFallback","appContext","globalStore","componentDataKey","attachComponentData","component","type","data","dataComponent","container","Map","defineProperty","enumerable","configurable","writable","has","name","displayName","getComponentData","useRouteRef","pathname","useLocation","routeResolutionApi","routeResolutionApiRef","useRouteResolutionApi","resolver","newRouteFunc","resolve","sourcePath","legacyRouteFunc","isOptional2","optional","isOptional","PluginErrorBoundary","Component","getDerivedStateFromError","error","state","handleErrorReset","setState","render","app","props","resetError","createRoutableExtension","mountPoint","createReactExtension","lazy","then","InnerComponent","RoutableExtensionWrapper","analytics","message","startsWith","useEffect","componentName","createComponentExtension","lazyLoader","default","ofExtension","sync","expose","Result","Suspense","fallback","entries","selectChildren","rootNode","featureFlagsApi","selector","strictError","Children","toArray","flatMap","isValidElement","Fragment","isActive","with","without","Collection","selectByComponentData","query","selection","withStrictError","findComponentData","filter","getElements","useElementFilter","filterFn","dependencies","featureFlagsApiRef","elements","PluginImpl","config","apis","featureFlags","slice","toString","createPlugin","routeRefType","Symbol","RouteRefImpl","params","title","$$type","version","T","alias","getParams","getDescription","setId","newId","createRouteRef","PARAM_PATTERN","SubRouteRefImpl","path","parent","getParent","createSubRouteRef","pathParams","split","p","substring","some","includes","endsWith","param","test","ExternalRouteRefImpl","defaultTarget","getDefaultTarget","createExternalRouteRef","Boolean","useRouteRefParams","_routeRef","useParams"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkinternal_plugin_kuadrant=self.webpackChunkinternal_plugin_kuadrant||[]).push([[441,2822],{12822:(e,t,n)=>{n.r(t),n.d(t,{createVersionedContext:()=>u,createVersionedContextForTesting:()=>l,createVersionedValueMap:()=>s,getOrCreateGlobalSingleton:()=>o,useVersionedContext:()=>c});const r="undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),a=e=>`__@backstage/${e}__`;function o(e,t){const n=a(e);let o=r[n];return o||(o=t(),r[n]=o,o)}var i=n(95478);function s(e){Object.freeze(e);const t={atVersion:t=>e[t]};return Object.defineProperty(t,"$map",{configurable:!0,enumerable:!0,get:()=>e}),t}function u(e){return o(e,()=>(0,i.createContext)(void 0))}function c(e){return(0,i.useContext)(u(e))}function l(e){return{set(t){globalThis[`__@backstage/${e}__`]=(0,i.createContext)(s(t))},reset(){delete globalThis[`__@backstage/${e}__`]}}}}}]);
|
|
2
|
+
//# sourceMappingURL=2822.27a4ac5b.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/2822.27a4ac5b.chunk.js","mappings":"sTASA,MAAMA,EARkB,oBAAXC,QAA0BA,OAAOC,OAASA,KAC5CD,OAEW,oBAATE,MAAwBA,KAAKD,OAASA,KACxCC,KAEFC,SAAS,cAATA,GAGHC,EAAWC,GAAO,gBAAgBA,MACxC,SAASC,EAA2BD,EAAIE,GACtC,MAAMC,EAAMJ,EAAQC,GACpB,IAAII,EAAQV,EAAaS,GACzB,OAAIC,IAGJA,EAAQF,IACRR,EAAaS,GAAOC,EACbA,EACT,C,eCpBA,SAASC,EAAwBC,GAC/BC,OAAOC,OAAOF,GACd,MAAMG,EAAiB,CACrBC,UAAUC,GACDL,EAASK,IAUpB,OAPAJ,OAAOK,eAAeH,EAAgB,OAAQ,CAC5CI,cAAc,EACdC,YAAY,EACZC,IAAG,IACMT,IAGJG,CACT,CCXA,SAASO,EAAuBb,GAC9B,OAAOF,EACLE,EACA,KAAM,IAAAc,oBAAc,GAExB,CACA,SAASC,EAAoBf,GAC3B,OAAO,IAAAgB,YAAWH,EAAuBb,GAC3C,CACA,SAASiB,EAAiCjB,GACxC,MAAO,CACL,GAAAkB,CAAIf,GACFgB,WAAW,gBAAgBnB,QAAW,IAAAc,eACpCZ,EAAwBC,GAE5B,EACA,KAAAiB,UACSD,WAAW,gBAAgBnB,MACpC,EAEJ,C","sources":["webpack://internal.plugin-kuadrant/./node_modules/@backstage/version-bridge/dist/lib/globalObject.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/version-bridge/dist/lib/VersionedValue.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/version-bridge/dist/lib/VersionedContext.esm.js"],"sourcesContent":["function getGlobalObject() {\n if (typeof window !== \"undefined\" && window.Math === Math) {\n return window;\n }\n if (typeof self !== \"undefined\" && self.Math === Math) {\n return self;\n }\n return Function(\"return this\")();\n}\nconst globalObject = getGlobalObject();\nconst makeKey = (id) => `__@backstage/${id}__`;\nfunction getOrCreateGlobalSingleton(id, supplier) {\n const key = makeKey(id);\n let value = globalObject[key];\n if (value) {\n return value;\n }\n value = supplier();\n globalObject[key] = value;\n return value;\n}\n\nexport { getOrCreateGlobalSingleton };\n//# sourceMappingURL=globalObject.esm.js.map\n","function createVersionedValueMap(versions) {\n Object.freeze(versions);\n const versionedValue = {\n atVersion(version) {\n return versions[version];\n }\n };\n Object.defineProperty(versionedValue, \"$map\", {\n configurable: true,\n enumerable: true,\n get() {\n return versions;\n }\n });\n return versionedValue;\n}\n\nexport { createVersionedValueMap };\n//# sourceMappingURL=VersionedValue.esm.js.map\n","import { createContext, useContext } from 'react';\nimport { getOrCreateGlobalSingleton } from './globalObject.esm.js';\nimport { createVersionedValueMap } from './VersionedValue.esm.js';\n\nfunction createVersionedContext(key) {\n return getOrCreateGlobalSingleton(\n key,\n () => createContext(void 0)\n );\n}\nfunction useVersionedContext(key) {\n return useContext(createVersionedContext(key));\n}\nfunction createVersionedContextForTesting(key) {\n return {\n set(versions) {\n globalThis[`__@backstage/${key}__`] = createContext(\n createVersionedValueMap(versions)\n );\n },\n reset() {\n delete globalThis[`__@backstage/${key}__`];\n }\n };\n}\n\nexport { createVersionedContext, createVersionedContextForTesting, useVersionedContext };\n//# sourceMappingURL=VersionedContext.esm.js.map\n"],"names":["globalObject","window","Math","self","Function","makeKey","id","getOrCreateGlobalSingleton","supplier","key","value","createVersionedValueMap","versions","Object","freeze","versionedValue","atVersion","version","defineProperty","configurable","enumerable","get","createVersionedContext","createContext","useVersionedContext","useContext","createVersionedContextForTesting","set","globalThis","reset"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkinternal_plugin_kuadrant=self.webpackChunkinternal_plugin_kuadrant||[]).push([[2967],{32269:(e,a,t)=>{var n=t(4293),i=t(78920);a.A=void 0;var r=i(t(95478)),s=(0,n(t(74044)).default)(r.createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"Visibility");a.A=s},35015:(e,a,t)=>{t.d(a,{A:()=>s});var n=t(95478),i=t(85608),r=t(71581);function s(e,a){void 0===a&&(a=[]);var t=function(e,a,t){void 0===a&&(a=[]),void 0===t&&(t={loading:!1});var s=(0,n.useRef)(0),l=(0,r.A)(),o=(0,n.useState)(t),c=o[0],d=o[1],h=(0,n.useCallback)(function(){for(var a=[],t=0;t<arguments.length;t++)a[t]=arguments[t];var n=++s.current;return c.loading||d(function(e){return(0,i.__assign)((0,i.__assign)({},e),{loading:!0})}),e.apply(void 0,a).then(function(e){return l()&&n===s.current&&d({value:e,loading:!1}),e},function(e){return l()&&n===s.current&&d({error:e,loading:!1}),e})},a);return[c,h]}(e,a,{loading:!0}),s=t[0],l=t[1];return(0,n.useEffect)(function(){l()},[l]),s}},46299:(e,a,t)=>{t.d(a,{S:()=>n});const n=e=>{const a={border:"none"};switch(e){case"Approved":return{...a,backgroundColor:"#4caf50",color:"#fff"};case"Rejected":return{...a,backgroundColor:"#f44336",color:"#fff"};default:return{...a,backgroundColor:"#ff9800",color:"#fff"}}}},52235:(e,a,t)=>{var n=t(4293),i=t(78920);a.A=void 0;var r=i(t(95478)),s=(0,n(t(74044)).default)(r.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward");a.A=s},55735:(e,a,t)=>{var n=t(4293),i=t(78920);a.A=void 0;var r=i(t(95478)),s=(0,n(t(74044)).default)(r.createElement("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}),"ArrowBack");a.A=s},61524:(e,a,t)=>{var n=t(4293),i=t(78920);a.A=void 0;var r=i(t(95478)),s=(0,n(t(74044)).default)(r.createElement("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff");a.A=s},72967:(e,a,t)=>{t.r(a),t.d(a,{ApiKeyDetailPage:()=>H});var n=t(31085),i=t(95478),r=t(49634),s=t(22097),l=t(35015),o=t(86687),c=t(42367),d=t(289),h=t(15831),p=t(37725),u=t(46681),m=t(94641),x=t(96040),A=t(58837),v=t(10394),y=t(71677),f=t(29365),j=t(64947),g=t(72501),b=t(42899),k=t(67720),C=t(31653),w=t(38605),P=t(76891),S=t(61477),N=t(46805),I=t(93453),B=t(32269),R=t(61524),z=t(99594),T=t(77225),$=t(55735),_=t(39330),L=t(85121),E=t(46299);const D=(0,A.A)(e=>({label:{fontWeight:600,color:e.palette.text.secondary,marginBottom:e.spacing(.5)},value:{marginBottom:e.spacing(2)},codeBlock:{backgroundColor:e.palette.background.default,padding:e.spacing(2),borderRadius:e.shape.borderRadius,fontFamily:"monospace",fontSize:"0.875rem",overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all"},apiKeyContainer:{display:"flex",alignItems:"center",gap:e.spacing(1),padding:e.spacing(1.5),backgroundColor:e.palette.background.default,borderRadius:e.shape.borderRadius,fontFamily:"monospace"},tabPanel:{marginTop:e.spacing(2)}})),K=({code:e,onCopy:a})=>{const t=D();return(0,n.jsxs)(v.A,{position:"relative",children:[(0,n.jsx)(v.A,{className:t.codeBlock,children:e}),(0,n.jsx)(y.Ay,{title:"Copy code",children:(0,n.jsx)(f.A,{size:"small",style:{position:"absolute",top:8,right:8},onClick:a,children:(0,n.jsx)(z.A,{fontSize:"small"})})})]})},H=()=>{var e,a,t,A,H,M,W,q,F,V;const U=D(),{namespace:O,name:G}=(0,r.useParams)(),Y=(0,s.useApi)(s.configApiRef),J=(0,s.useApi)(s.fetchApiRef),Q=(0,s.useApi)(s.alertApiRef),X=Y.getString("backend.baseUrl"),[Z,ee]=(0,i.useState)(0),[ae,te]=(0,i.useState)(!1),[ne,ie]=(0,i.useState)(null),[re,se]=(0,i.useState)(!1),[le,oe]=(0,i.useState)(!1),[ce,de]=(0,i.useState)(!1),{value:he,loading:pe,error:ue}=(0,l.A)(async()=>{var e;const[a,t]=await Promise.all([J.fetch(`${X}/api/kuadrant/apikeys/${O}/${G}`),J.fetch(`${X}/api/kuadrant/apiproducts`)]);if(!a.ok)throw new Error("Failed to fetch API key");const n=await a.json();let i;return!1===(null===(e=n.status)||void 0===e?void 0:e.canReadSecret)&&oe(!0),t.ok&&(i=((await t.json()).items||[]).find(e=>{var a;return e.metadata.name===(null===(a=n.spec.apiProductRef)||void 0===a?void 0:a.name)&&e.metadata.namespace===n.metadata.namespace})),{apiKey:n,apiProduct:i}},[O,G,X,J]),me=null==he?void 0:he.apiKey,xe=null==he?void 0:he.apiProduct,Ae=async e=>{await navigator.clipboard.writeText(e),Q.post({message:"Copied to clipboard",severity:"success",display:"transient"})};if(pe)return(0,n.jsx)(o.k,{});if(ue||!me)return(0,n.jsx)(c._,{error:ue||new Error("API key not found")});const ve=(null===(e=me.status)||void 0===e?void 0:e.phase)||"Pending",ye="Approved"===ve?"Active":ve,fe=(null===(a=me.status)||void 0===a?void 0:a.apiHostname)||"api.example.com",je=ne||"<your-api-key>",ge=[{label:"cURL",code:`curl -H "Authorization: Bearer ${je}" \\\n https://${fe}/`},{label:"Node.js",code:`const response = await fetch('https://${fe}/', {\n headers: {\n 'Authorization': 'Bearer ${je}'\n }\n});\nconst data = await response.json();`},{label:"Python",code:`import requests\n\nresponse = requests.get(\n 'https://${fe}/',\n headers={'Authorization': 'Bearer ${je}'}\n)\ndata = response.json()`},{label:"Go",code:`package main\n\nimport (\n "net/http"\n)\n\nfunc main() {\n client := &http.Client{}\n req, _ := http.NewRequest("GET", "https://${fe}/", nil)\n req.Header.Set("Authorization", "Bearer ${je}")\n resp, _ := client.Do(req)\n defer resp.Body.Close()\n}`}];return(0,n.jsxs)(d.Y,{themeId:"tool",children:[(0,n.jsx)(h.Y,{title:me.metadata.name,subtitle:`API Key for ${(null===(t=me.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"}`,children:(0,n.jsx)(p.N_,{to:"/kuadrant/api-keys",children:(0,n.jsx)(j.A,{startIcon:(0,n.jsx)($.A,{}),children:"Back to API Keys"})})}),(0,n.jsxs)(u.U,{children:[(0,n.jsx)(v.A,{mb:2,children:(0,n.jsxs)(m.B,{"aria-label":"breadcrumb",children:[(0,n.jsx)(p.N_,{to:"/kuadrant/api-keys",children:"API keys"}),(0,n.jsx)(g.A,{children:me.metadata.name})]})}),(0,n.jsxs)(v.A,{mb:3,display:"flex",style:{gap:8},children:[(0,n.jsx)(p.N_,{to:`/catalog/default/api/${null===(A=me.spec.apiProductRef)||void 0===A?void 0:A.name}`,children:(0,n.jsx)(j.A,{variant:"outlined",startIcon:(0,n.jsx)(_.A,{}),"data-testid":"view-api-button",children:"View API"})}),(null==xe||null===(H=xe.spec)||void 0===H?void 0:H.contact)&&(xe.spec.contact.email||xe.spec.contact.url||xe.spec.contact.slack)&&(0,n.jsx)(j.A,{variant:"outlined",startIcon:(0,n.jsx)(L.A,{}),href:xe.spec.contact.email?`mailto:${xe.spec.contact.email}`:xe.spec.contact.slack?xe.spec.contact.slack:xe.spec.contact.url||"#",target:"_blank",rel:"noopener noreferrer",children:"Contact Owner"})]}),(0,n.jsxs)(b.A,{container:!0,spacing:3,children:[(0,n.jsx)(b.A,{item:!0,xs:12,md:6,children:(0,n.jsx)(x.n,{title:"API Key Details",children:(0,n.jsxs)(v.A,{children:[(0,n.jsx)(g.A,{variant:"caption",className:U.label,children:"Status"}),(0,n.jsx)(v.A,{className:U.value,children:(0,n.jsx)(k.A,{label:ye,size:"small",style:(0,E.S)(ve),"data-testid":"api-key-status-chip"})}),(0,n.jsx)(g.A,{variant:"caption",className:U.label,children:"API Product"}),(0,n.jsx)(g.A,{variant:"body1",className:U.value,children:(0,n.jsx)(p.N_,{to:`/catalog/default/api/${null===(M=me.spec.apiProductRef)||void 0===M?void 0:M.name}/api-keys`,children:(null===(W=me.spec.apiProductRef)||void 0===W?void 0:W.name)||"unknown"})}),(0,n.jsx)(g.A,{variant:"caption",className:U.label,children:"Tier"}),(0,n.jsx)(v.A,{className:U.value,children:(0,n.jsx)(k.A,{label:me.spec.planTier,size:"small",variant:"outlined"})}),(0,n.jsx)(g.A,{variant:"caption",className:U.label,children:"Requester"}),(0,n.jsx)(g.A,{variant:"body1",className:U.value,children:null===(q=me.spec.requestedBy)||void 0===q?void 0:q.userId}),(0,n.jsx)(g.A,{variant:"caption",className:U.label,children:"Requested"}),(0,n.jsx)(g.A,{variant:"body1",className:U.value,children:me.metadata.creationTimestamp?new Date(me.metadata.creationTimestamp).toLocaleDateString():"-"}),(null===(F=me.status)||void 0===F?void 0:F.reviewedBy)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g.A,{variant:"caption",className:U.label,children:"Reviewed By"}),(0,n.jsxs)(g.A,{variant:"body1",className:U.value,children:[me.status.reviewedBy.replace(/^user:default\//,""),me.status.reviewedAt&&(0,n.jsxs)(g.A,{variant:"caption",color:"textSecondary",children:[" ","on"," ",new Date(me.status.reviewedAt).toLocaleDateString()]})]})]})]})})}),(0,n.jsxs)(b.A,{item:!0,xs:12,md:6,children:[(0,n.jsx)(x.n,{title:"Use Case",children:(0,n.jsx)(g.A,{variant:"body1",children:me.spec.useCase||"No use case provided"})}),"Approved"===ve&&(0,n.jsx)(v.A,{mt:2,children:(0,n.jsx)(x.n,{title:"API Key",children:le&&!ne?(0,n.jsx)(y.Ay,{title:"This API key has already been viewed and cannot be retrieved again",children:(0,n.jsxs)(v.A,{display:"flex",alignItems:"center",children:[(0,n.jsx)(g.A,{variant:"body2",color:"textSecondary",children:"Already viewed - cannot be retrieved again"}),(0,n.jsx)(R.A,{fontSize:"small",color:"disabled",style:{marginLeft:8}})]})}):(0,n.jsxs)(v.A,{className:U.apiKeyContainer,children:[(0,n.jsx)(g.A,{variant:"body2",style:{fontFamily:"monospace",flex:1},children:re?"Loading...":ae&&ne?ne:"•".repeat(32)}),ae&&ne&&(0,n.jsx)(y.Ay,{title:"Copy to clipboard",children:(0,n.jsx)(f.A,{size:"small",onClick:()=>Ae(ne),children:(0,n.jsx)(z.A,{fontSize:"small"})})}),(0,n.jsx)(y.Ay,{title:ae?"Hide API key":"Reveal API key (one-time only)",children:(0,n.jsx)("span",{children:(0,n.jsx)(f.A,{size:"small",onClick:()=>{ae?(te(!1),ie(null)):le||de(!0)},disabled:re||le&&!ne,children:ae?(0,n.jsx)(R.A,{fontSize:"small"}):(0,n.jsx)(B.A,{fontSize:"small"})})})})]})})})]}),"Approved"===ve&&(0,n.jsx)(b.A,{item:!0,xs:12,children:(0,n.jsx)(x.n,{title:"Code Examples",children:(0,n.jsxs)(v.A,{children:[(0,n.jsx)(C.A,{value:Z,onChange:(e,a)=>ee(a),indicatorColor:"primary",textColor:"primary",children:ge.map(e=>(0,n.jsx)(w.A,{label:e.label},e.label))}),(0,n.jsx)(v.A,{className:U.tabPanel,children:(0,n.jsx)(K,{code:ge[Z].code,onCopy:()=>Ae(ge[Z].code)})})]})})}),(null===(V=me.status)||void 0===V?void 0:V.limits)&&(0,n.jsx)(b.A,{item:!0,xs:12,children:(0,n.jsx)(x.n,{title:"Rate Limits",children:(0,n.jsxs)(b.A,{container:!0,spacing:2,children:[me.status.limits.daily&&(0,n.jsxs)(b.A,{item:!0,children:[(0,n.jsx)(g.A,{variant:"caption",className:U.label,children:"Daily"}),(0,n.jsx)(g.A,{variant:"h6",children:me.status.limits.daily.toLocaleString()})]}),me.status.limits.weekly&&(0,n.jsxs)(b.A,{item:!0,children:[(0,n.jsx)(g.A,{variant:"caption",className:U.label,children:"Weekly"}),(0,n.jsx)(g.A,{variant:"h6",children:me.status.limits.weekly.toLocaleString()})]}),me.status.limits.monthly&&(0,n.jsxs)(b.A,{item:!0,children:[(0,n.jsx)(g.A,{variant:"caption",className:U.label,children:"Monthly"}),(0,n.jsx)(g.A,{variant:"h6",children:me.status.limits.monthly.toLocaleString()})]})]})})})]})]}),(0,n.jsxs)(P.A,{open:ce,onClose:()=>de(!1),maxWidth:"sm",children:[(0,n.jsx)(S.A,{children:(0,n.jsxs)(v.A,{display:"flex",alignItems:"center",children:[(0,n.jsx)(T.A,{color:"primary",style:{marginRight:8}}),"View API Key"]})}),(0,n.jsxs)(N.A,{children:[(0,n.jsxs)(g.A,{variant:"body1",paragraph:!0,children:["This API key can only be viewed ",(0,n.jsx)("strong",{children:"once"}),". After you reveal it, you will not be able to retrieve it again."]}),(0,n.jsx)(g.A,{variant:"body2",color:"textSecondary",children:"Make sure to copy and store it securely before closing this view."})]}),(0,n.jsxs)(I.A,{children:[(0,n.jsx)(j.A,{onClick:()=>de(!1),children:"Cancel"}),(0,n.jsx)(j.A,{variant:"contained",color:"primary",onClick:()=>{de(!1),(async()=>{se(!0);try{const e=await J.fetch(`${X}/api/kuadrant/apikeys/${O}/${G}/secret`);if(e.ok){const a=await e.json();ie(a.apiKey),oe(!0),te(!0)}else 403===e.status&&(oe(!0),Q.post({message:"This API key has already been viewed and cannot be retrieved again.",severity:"warning",display:"transient"}))}catch(e){console.error("Failed to fetch API key:",e),Q.post({message:"Failed to fetch API key",severity:"error",display:"transient"})}finally{se(!1)}})()},children:"Reveal API Key"})]})]})]})}},85121:(e,a,t)=>{var n=t(4293),i=t(78920);a.A=void 0;var r=i(t(95478)),s=(0,n(t(74044)).default)(r.createElement("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"}),"Email");a.A=s},96040:(e,a,t)=>{t.d(a,{n:()=>B});var n=t(31085),i=t(40703),r=t(59469),s=t(48653),l=t(45685),o=t(37197),c=t(37976),d=t(53373),h=t.n(d),p=t(10394),u=t(72501),m=t(52235),x=t(37725);const A=(0,c.makeStyles)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function v(e){const{link:a,title:t,onClick:i}=e,r=A();return(0,n.jsxs)(p.A,{children:[(0,n.jsx)(o.A,{}),(0,n.jsx)(x.N_,{to:a,onClick:i,underline:"none",children:(0,n.jsxs)(p.A,{display:"flex",alignItems:"center",className:r.root,children:[(0,n.jsx)(p.A,{className:r.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(u.A,{children:(0,n.jsx)("strong",{children:t})})}),(0,n.jsx)(m.A,{className:r.arrow})]})})]})}var y=t(95478),f=t(64947);const j=(0,y.forwardRef)((e,a)=>(0,n.jsx)(x.N_,{ref:a,...e,color:"initial"})),g=(0,y.forwardRef)((e,a)=>(0,n.jsx)(f.A,{ref:a,component:j,...e}));var b=t(34169),k=t(21006),C=t(67550);const w=e=>{const{slackChannel:a}=e,{t}=(0,C.i)(k.O);return a?"string"==typeof a?(0,n.jsx)(u.A,{children:t("errorBoundary.title",{slackChannel:a})}):a.href?(0,n.jsx)(g,{to:a.href,variant:"contained",children:a.name}):(0,n.jsx)(u.A,{children:t("errorBoundary.title",{slackChannel:a.name})}):null},P=class extends y.Component{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(e,a){console.error(`ErrorBoundary, error: ${e}`,{error:e,errorInfo:a}),this.setState({error:e,errorInfo:a})}render(){const{slackChannel:e,children:a}=this.props,{error:t}=this.state;return t?(0,n.jsx)(b.b,{title:"Something Went Wrong",error:t,children:(0,n.jsx)(w,{slackChannel:e})}):a}},S=(0,c.makeStyles)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),N=(0,c.withStyles)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(r.A),I={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function B(e){const{title:a,subheader:t,divider:c=!0,deepLink:d,slackChannel:p,errorBoundaryProps:u,variant:m,alignContent:x="normal",children:A,headerStyle:y,headerProps:f,icon:j,action:g,actionsClassName:b,actions:k,cardClassName:C,actionsTopRight:w,className:B,noPadding:R,titleTypographyProps:z,subheaderTypographyProps:T}=e,$=S();let _={},L={};m&&m.split(/[\s]+/g).forEach(e=>{_={..._,...I.card[e]},L={...L,...I.cardContent[e]}});const E=u||(p?{slackChannel:p}:{});return(0,n.jsx)(i.A,{style:_,className:B,children:(0,n.jsxs)(P,{...E,children:[a&&(0,n.jsx)(l.A,{classes:{root:h()($.header),title:$.headerTitle,subheader:$.headerSubheader,avatar:$.headerAvatar,action:$.headerAction,content:$.headerContent},title:a,subheader:t||j?(0,n.jsxs)("div",{"data-testid":"info-card-subheader",children:[t&&(0,n.jsx)("div",{className:$.subheader,children:t}),j]}):null,action:g,style:{...y},titleTypographyProps:z,subheaderTypographyProps:T,...f}),w&&(0,n.jsx)(N,{children:w}),c&&(0,n.jsx)(o.A,{}),(0,n.jsx)(s.A,{className:h()(C,{[$.noPadding]:R,[$.contentAlignBottom]:"bottom"===x}),style:L,children:A}),k&&(0,n.jsx)(r.A,{className:b,children:k}),d&&(0,n.jsx)(v,{...d})]})})}}}]);
|
|
2
|
+
//# sourceMappingURL=2967.8d9c1b1f.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/2967.8d9c1b1f.chunk.js","mappings":"yIAEIA,EAAyB,EAAQ,MAEjCC,EAA0B,EAAQ,OAKtCC,EAAQ,OAAU,EAElB,IAAIC,EAAQF,EAAwB,EAAQ,QAIxCG,GAAW,EAFMJ,EAAuB,EAAQ,QAElBK,SAAuBF,EAAMG,cAAc,OAAQ,CACnFC,EAAG,sNACD,cAEJL,EAAQ,EAAUE,C,wECjBH,SAASI,EAASC,EAAIC,QACpB,IAATA,IAAmBA,EAAO,IAC9B,IAAIC,ECDO,SAAoBF,EAAIC,EAAME,QAC5B,IAATF,IAAmBA,EAAO,SACT,IAAjBE,IAA2BA,EAAe,CAAEC,SAAS,IACzD,IA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D,KACdsE,EAAA,EACA,CACErO,UAAW,IAAWwN,EAAe,CACnC,CAAC3N,EAAQwL,WAAYA,EACrB,CAACxL,EAAQ0L,oBAAsC,WAAjB0B,IAEhC5M,MAAOwN,EACP/D,aAGJyD,IAA2B,IAAAxD,KAAIsC,EAAA,EAAa,CAAErM,UAAWsN,EAAkBxD,SAAUyD,IACrFR,IAA4B,IAAAhD,KAAIL,EAAY,IAAKqD,QAErD,C","sources":["webpack://internal.plugin-kuadrant/../../node_modules/@material-ui/icons/Visibility.js","webpack://internal.plugin-kuadrant/../../node_modules/react-use/esm/useAsync.js","webpack://internal.plugin-kuadrant/../../node_modules/react-use/esm/useAsyncFn.js","webpack://internal.plugin-kuadrant/./src/utils/styles.ts","webpack://internal.plugin-kuadrant/../../node_modules/@material-ui/icons/ArrowForward.js","webpack://internal.plugin-kuadrant/../../node_modules/@material-ui/icons/ArrowBack.js","webpack://internal.plugin-kuadrant/../../node_modules/@material-ui/icons/VisibilityOff.js","webpack://internal.plugin-kuadrant/./src/components/ApiKeyDetailPage/ApiKeyDetailPage.tsx","webpack://internal.plugin-kuadrant/../../node_modules/@material-ui/icons/Email.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/core-components/dist/layout/BottomLink/BottomLink.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/core-components/dist/components/LinkButton/LinkButton.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/core-components/dist/layout/ErrorBoundary/ErrorBoundary.esm.js","webpack://internal.plugin-kuadrant/./node_modules/@backstage/core-components/dist/layout/InfoCard/InfoCard.esm.js"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z\"\n}), 'Visibility');\n\nexports.default = _default;","import { useEffect } from 'react';\nimport useAsyncFn from './useAsyncFn';\nexport default function useAsync(fn, deps) {\n if (deps === void 0) { deps = []; }\n var _a = useAsyncFn(fn, deps, {\n loading: true,\n }), state = _a[0], callback = _a[1];\n useEffect(function () {\n callback();\n }, [callback]);\n return state;\n}\n","import { __assign } from \"tslib\";\nimport { useCallback, useRef, useState } from 'react';\nimport useMountedState from './useMountedState';\nexport default function useAsyncFn(fn, deps, initialState) {\n if (deps === void 0) { deps = []; }\n if (initialState === void 0) { initialState = { loading: false }; }\n var lastCallId = useRef(0);\n var isMounted = useMountedState();\n var _a = useState(initialState), state = _a[0], set = _a[1];\n var callback = useCallback(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var callId = ++lastCallId.current;\n if (!state.loading) {\n set(function (prevState) { return (__assign(__assign({}, prevState), { loading: true })); });\n }\n return fn.apply(void 0, args).then(function (value) {\n isMounted() && callId === lastCallId.current && set({ value: value, loading: false });\n return value;\n }, function (error) {\n isMounted() && callId === lastCallId.current && set({ error: error, loading: false });\n return error;\n });\n }, deps);\n return [state, callback];\n}\n","import { CSSProperties } from \"react\";\n\n/**\n * Returns inline styles for API key status chips.\n * Uses inline styles to ensure proper specificity with Material-UI Chip.\n */\nexport const getStatusChipStyle = (phase: string): CSSProperties => {\n const base = { border: \"none\" };\n switch (phase) {\n case \"Approved\":\n return { ...base, backgroundColor: \"#4caf50\", color: \"#fff\" };\n case \"Rejected\":\n return { ...base, backgroundColor: \"#f44336\", color: \"#fff\" };\n default:\n return { ...base, backgroundColor: \"#ff9800\", color: \"#fff\" };\n }\n};\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\"\n}), 'ArrowForward');\n\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\"\n}), 'ArrowBack');\n\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z\"\n}), 'VisibilityOff');\n\nexports.default = _default;","import React, { useState } from \"react\";\nimport { useParams } from \"react-router-dom\";\nimport {\n useApi,\n configApiRef,\n fetchApiRef,\n alertApiRef,\n} from \"@backstage/core-plugin-api\";\nimport { useAsync } from \"react-use\";\nimport {\n Header,\n Page,\n Content,\n Progress,\n ResponseErrorPanel,\n InfoCard,\n Link,\n Breadcrumbs,\n} from \"@backstage/core-components\";\nimport {\n Box,\n Grid,\n Typography,\n Chip,\n IconButton,\n Tooltip,\n Tabs,\n Tab,\n Button,\n Dialog,\n DialogTitle,\n DialogContent,\n DialogActions,\n makeStyles,\n} from \"@material-ui/core\";\nimport VisibilityIcon from \"@material-ui/icons/Visibility\";\nimport VisibilityOffIcon from \"@material-ui/icons/VisibilityOff\";\nimport FileCopyIcon from \"@material-ui/icons/FileCopy\";\nimport WarningIcon from \"@material-ui/icons/Warning\";\nimport ArrowBackIcon from \"@material-ui/icons/ArrowBack\";\nimport OpenInNewIcon from \"@material-ui/icons/OpenInNew\";\nimport EmailIcon from \"@material-ui/icons/Email\";\nimport { APIKey, APIProduct } from \"../../types/api-management\";\nimport { getStatusChipStyle } from \"../../utils/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n label: {\n fontWeight: 600,\n color: theme.palette.text.secondary,\n marginBottom: theme.spacing(0.5),\n },\n value: {\n marginBottom: theme.spacing(2),\n },\n codeBlock: {\n backgroundColor: theme.palette.background.default,\n padding: theme.spacing(2),\n borderRadius: theme.shape.borderRadius,\n fontFamily: \"monospace\",\n fontSize: \"0.875rem\",\n overflow: \"auto\",\n whiteSpace: \"pre-wrap\",\n wordBreak: \"break-all\",\n },\n apiKeyContainer: {\n display: \"flex\",\n alignItems: \"center\",\n gap: theme.spacing(1),\n padding: theme.spacing(1.5),\n backgroundColor: theme.palette.background.default,\n borderRadius: theme.shape.borderRadius,\n fontFamily: \"monospace\",\n },\n tabPanel: {\n marginTop: theme.spacing(2),\n },\n}));\n\nconst CodeExample = ({\n code,\n onCopy,\n}: {\n code: string;\n onCopy: () => void;\n}) => {\n const classes = useStyles();\n\n return (\n <Box position=\"relative\">\n <Box className={classes.codeBlock}>{code}</Box>\n <Tooltip title=\"Copy code\">\n <IconButton\n size=\"small\"\n style={{ position: \"absolute\", top: 8, right: 8 }}\n onClick={onCopy}\n >\n <FileCopyIcon fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n </Box>\n );\n};\n\nexport const ApiKeyDetailPage = () => {\n const classes = useStyles();\n const { namespace, name } = useParams<{ namespace: string; name: string }>();\n const config = useApi(configApiRef);\n const fetchApi = useApi(fetchApiRef);\n const alertApi = useApi(alertApiRef);\n const backendUrl = config.getString(\"backend.baseUrl\");\n\n const [selectedTab, setSelectedTab] = useState(0);\n const [showApiKey, setShowApiKey] = useState(false);\n const [apiKeyValue, setApiKeyValue] = useState<string | null>(null);\n const [apiKeyLoading, setApiKeyLoading] = useState(false);\n const [alreadyRead, setAlreadyRead] = useState(false);\n const [showWarning, setShowWarning] = useState(false);\n\n const {\n value: data,\n loading,\n error,\n } = useAsync(async () => {\n const [apiKeyResponse, productsResponse] = await Promise.all([\n fetchApi.fetch(`${backendUrl}/api/kuadrant/apikeys/${namespace}/${name}`),\n fetchApi.fetch(`${backendUrl}/api/kuadrant/apiproducts`),\n ]);\n\n if (!apiKeyResponse.ok) {\n throw new Error(\"Failed to fetch API key\");\n }\n const apiKeyData = await apiKeyResponse.json();\n\n // check if key has already been read\n if (apiKeyData.status?.canReadSecret === false) {\n setAlreadyRead(true);\n }\n\n // find matching api product to get contact info\n let apiProduct: APIProduct | undefined;\n if (productsResponse.ok) {\n const productsData = await productsResponse.json();\n apiProduct = (productsData.items || []).find(\n (p: APIProduct) =>\n p.metadata.name === apiKeyData.spec.apiProductRef?.name &&\n p.metadata.namespace === apiKeyData.metadata.namespace,\n );\n }\n\n return { apiKey: apiKeyData as APIKey, apiProduct };\n }, [namespace, name, backendUrl, fetchApi]);\n\n const apiKey = data?.apiKey;\n const apiProduct = data?.apiProduct;\n\n const fetchApiKeySecret = async () => {\n setApiKeyLoading(true);\n try {\n const response = await fetchApi.fetch(\n `${backendUrl}/api/kuadrant/apikeys/${namespace}/${name}/secret`,\n );\n if (response.ok) {\n const data = await response.json();\n setApiKeyValue(data.apiKey);\n setAlreadyRead(true);\n setShowApiKey(true);\n } else if (response.status === 403) {\n setAlreadyRead(true);\n alertApi.post({\n message:\n \"This API key has already been viewed and cannot be retrieved again.\",\n severity: \"warning\",\n display: \"transient\",\n });\n }\n } catch (err) {\n console.error(\"Failed to fetch API key:\", err);\n alertApi.post({\n message: \"Failed to fetch API key\",\n severity: \"error\",\n display: \"transient\",\n });\n } finally {\n setApiKeyLoading(false);\n }\n };\n\n const handleRevealClick = () => {\n if (showApiKey) {\n setShowApiKey(false);\n setApiKeyValue(null);\n } else if (!alreadyRead) {\n setShowWarning(true);\n }\n };\n\n const handleConfirmReveal = () => {\n setShowWarning(false);\n fetchApiKeySecret();\n };\n\n const handleCopy = async (text: string) => {\n await navigator.clipboard.writeText(text);\n alertApi.post({\n message: \"Copied to clipboard\",\n severity: \"success\",\n display: \"transient\",\n });\n };\n\n if (loading) {\n return <Progress />;\n }\n\n if (error || !apiKey) {\n return (\n <ResponseErrorPanel error={error || new Error(\"API key not found\")} />\n );\n }\n\n const phase = apiKey.status?.phase || \"Pending\";\n const statusLabel = phase === \"Approved\" ? \"Active\" : phase;\n const hostname = apiKey.status?.apiHostname || \"api.example.com\";\n const displayApiKey = apiKeyValue || \"<your-api-key>\";\n\n // code examples\n const curlExample = `curl -H \"Authorization: Bearer ${displayApiKey}\" \\\\\n https://${hostname}/`;\n\n const nodeExample = `const response = await fetch('https://${hostname}/', {\n headers: {\n 'Authorization': 'Bearer ${displayApiKey}'\n }\n});\nconst data = await response.json();`;\n\n const pythonExample = `import requests\n\nresponse = requests.get(\n 'https://${hostname}/',\n headers={'Authorization': 'Bearer ${displayApiKey}'}\n)\ndata = response.json()`;\n\n const goExample = `package main\n\nimport (\n \"net/http\"\n)\n\nfunc main() {\n client := &http.Client{}\n req, _ := http.NewRequest(\"GET\", \"https://${hostname}/\", nil)\n req.Header.Set(\"Authorization\", \"Bearer ${displayApiKey}\")\n resp, _ := client.Do(req)\n defer resp.Body.Close()\n}`;\n\n const codeExamples = [\n { label: \"cURL\", code: curlExample },\n { label: \"Node.js\", code: nodeExample },\n { label: \"Python\", code: pythonExample },\n { label: \"Go\", code: goExample },\n ];\n\n return (\n <Page themeId=\"tool\">\n <Header\n title={apiKey.metadata.name}\n subtitle={`API Key for ${apiKey.spec.apiProductRef?.name || \"unknown\"}`}\n >\n <Link to=\"/kuadrant/api-keys\">\n <Button startIcon={<ArrowBackIcon />}>Back to API Keys</Button>\n </Link>\n </Header>\n <Content>\n <Box mb={2}>\n <Breadcrumbs aria-label=\"breadcrumb\">\n <Link to=\"/kuadrant/api-keys\">API keys</Link>\n <Typography>{apiKey.metadata.name}</Typography>\n </Breadcrumbs>\n </Box>\n\n <Box mb={3} display=\"flex\" style={{ gap: 8 }}>\n <Link to={`/catalog/default/api/${apiKey.spec.apiProductRef?.name}`}>\n <Button\n variant=\"outlined\"\n startIcon={<OpenInNewIcon />}\n data-testid=\"view-api-button\"\n >\n View API\n </Button>\n </Link>\n {apiProduct?.spec?.contact &&\n (apiProduct.spec.contact.email ||\n apiProduct.spec.contact.url ||\n apiProduct.spec.contact.slack) && (\n <Button\n variant=\"outlined\"\n startIcon={<EmailIcon />}\n href={\n apiProduct.spec.contact.email\n ? `mailto:${apiProduct.spec.contact.email}`\n : apiProduct.spec.contact.slack\n ? apiProduct.spec.contact.slack\n : apiProduct.spec.contact.url || \"#\"\n }\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Contact Owner\n </Button>\n )}\n </Box>\n\n <Grid container spacing={3}>\n <Grid item xs={12} md={6}>\n <InfoCard title=\"API Key Details\">\n <Box>\n <Typography variant=\"caption\" className={classes.label}>\n Status\n </Typography>\n <Box className={classes.value}>\n <Chip\n label={statusLabel}\n size=\"small\"\n style={getStatusChipStyle(phase)}\n data-testid=\"api-key-status-chip\"\n />\n </Box>\n\n <Typography variant=\"caption\" className={classes.label}>\n API Product\n </Typography>\n <Typography variant=\"body1\" className={classes.value}>\n <Link\n to={`/catalog/default/api/${apiKey.spec.apiProductRef?.name}/api-keys`}\n >\n {apiKey.spec.apiProductRef?.name || \"unknown\"}\n </Link>\n </Typography>\n\n <Typography variant=\"caption\" className={classes.label}>\n Tier\n </Typography>\n <Box className={classes.value}>\n <Chip\n label={apiKey.spec.planTier}\n size=\"small\"\n variant=\"outlined\"\n />\n </Box>\n\n <Typography variant=\"caption\" className={classes.label}>\n Requester\n </Typography>\n <Typography variant=\"body1\" className={classes.value}>\n {apiKey.spec.requestedBy?.userId}\n </Typography>\n\n <Typography variant=\"caption\" className={classes.label}>\n Requested\n </Typography>\n <Typography variant=\"body1\" className={classes.value}>\n {apiKey.metadata.creationTimestamp\n ? new Date(\n apiKey.metadata.creationTimestamp,\n ).toLocaleDateString()\n : \"-\"}\n </Typography>\n\n {apiKey.status?.reviewedBy && (\n <>\n <Typography variant=\"caption\" className={classes.label}>\n Reviewed By\n </Typography>\n <Typography variant=\"body1\" className={classes.value}>\n {apiKey.status.reviewedBy.replace(/^user:default\\//, \"\")}\n {apiKey.status.reviewedAt && (\n <Typography variant=\"caption\" color=\"textSecondary\">\n {\" \"}\n on{\" \"}\n {new Date(\n apiKey.status.reviewedAt,\n ).toLocaleDateString()}\n </Typography>\n )}\n </Typography>\n </>\n )}\n </Box>\n </InfoCard>\n </Grid>\n\n <Grid item xs={12} md={6}>\n <InfoCard title=\"Use Case\">\n <Typography variant=\"body1\">\n {apiKey.spec.useCase || \"No use case provided\"}\n </Typography>\n </InfoCard>\n\n {phase === \"Approved\" && (\n <Box mt={2}>\n <InfoCard title=\"API Key\">\n {alreadyRead && !apiKeyValue ? (\n <Tooltip title=\"This API key has already been viewed and cannot be retrieved again\">\n <Box display=\"flex\" alignItems=\"center\">\n <Typography variant=\"body2\" color=\"textSecondary\">\n Already viewed - cannot be retrieved again\n </Typography>\n <VisibilityOffIcon\n fontSize=\"small\"\n color=\"disabled\"\n style={{ marginLeft: 8 }}\n />\n </Box>\n </Tooltip>\n ) : (\n <Box className={classes.apiKeyContainer}>\n <Typography\n variant=\"body2\"\n style={{ fontFamily: \"monospace\", flex: 1 }}\n >\n {apiKeyLoading\n ? \"Loading...\"\n : showApiKey && apiKeyValue\n ? apiKeyValue\n : \"•\".repeat(32)}\n </Typography>\n {showApiKey && apiKeyValue && (\n <Tooltip title=\"Copy to clipboard\">\n <IconButton\n size=\"small\"\n onClick={() => handleCopy(apiKeyValue)}\n >\n <FileCopyIcon fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n )}\n <Tooltip\n title={\n showApiKey\n ? \"Hide API key\"\n : \"Reveal API key (one-time only)\"\n }\n >\n <span>\n <IconButton\n size=\"small\"\n onClick={handleRevealClick}\n disabled={\n apiKeyLoading || (alreadyRead && !apiKeyValue)\n }\n >\n {showApiKey ? (\n <VisibilityOffIcon fontSize=\"small\" />\n ) : (\n <VisibilityIcon fontSize=\"small\" />\n )}\n </IconButton>\n </span>\n </Tooltip>\n </Box>\n )}\n </InfoCard>\n </Box>\n )}\n </Grid>\n\n {phase === \"Approved\" && (\n <Grid item xs={12}>\n <InfoCard title=\"Code Examples\">\n <Box>\n <Tabs\n value={selectedTab}\n onChange={(_, newValue) => setSelectedTab(newValue)}\n indicatorColor=\"primary\"\n textColor=\"primary\"\n >\n {codeExamples.map((ex) => (\n <Tab key={ex.label} label={ex.label} />\n ))}\n </Tabs>\n <Box className={classes.tabPanel}>\n <CodeExample\n code={codeExamples[selectedTab].code}\n onCopy={() => handleCopy(codeExamples[selectedTab].code)}\n />\n </Box>\n </Box>\n </InfoCard>\n </Grid>\n )}\n\n {apiKey.status?.limits && (\n <Grid item xs={12}>\n <InfoCard title=\"Rate Limits\">\n <Grid container spacing={2}>\n {apiKey.status.limits.daily && (\n <Grid item>\n <Typography variant=\"caption\" className={classes.label}>\n Daily\n </Typography>\n <Typography variant=\"h6\">\n {apiKey.status.limits.daily.toLocaleString()}\n </Typography>\n </Grid>\n )}\n {apiKey.status.limits.weekly && (\n <Grid item>\n <Typography variant=\"caption\" className={classes.label}>\n Weekly\n </Typography>\n <Typography variant=\"h6\">\n {apiKey.status.limits.weekly.toLocaleString()}\n </Typography>\n </Grid>\n )}\n {apiKey.status.limits.monthly && (\n <Grid item>\n <Typography variant=\"caption\" className={classes.label}>\n Monthly\n </Typography>\n <Typography variant=\"h6\">\n {apiKey.status.limits.monthly.toLocaleString()}\n </Typography>\n </Grid>\n )}\n </Grid>\n </InfoCard>\n </Grid>\n )}\n </Grid>\n </Content>\n\n <Dialog\n open={showWarning}\n onClose={() => setShowWarning(false)}\n maxWidth=\"sm\"\n >\n <DialogTitle>\n <Box display=\"flex\" alignItems=\"center\">\n <WarningIcon color=\"primary\" style={{ marginRight: 8 }} />\n View API Key\n </Box>\n </DialogTitle>\n <DialogContent>\n <Typography variant=\"body1\" paragraph>\n This API key can only be viewed <strong>once</strong>. After you\n reveal it, you will not be able to retrieve it again.\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\">\n Make sure to copy and store it securely before closing this view.\n </Typography>\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setShowWarning(false)}>Cancel</Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={handleConfirmReveal}\n >\n Reveal API Key\n </Button>\n </DialogActions>\n </Dialog>\n </Page>\n );\n};\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z\"\n}), 'Email');\n\nexports.default = _default;","import { jsxs, jsx } from 'react/jsx-runtime';\nimport Box from '@material-ui/core/Box';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport ArrowIcon from '@material-ui/icons/ArrowForward';\nimport { Link } from '../../components/Link/Link.esm.js';\n\nconst useStyles = makeStyles(\n (theme) => ({\n root: {\n maxWidth: \"fit-content\",\n padding: theme.spacing(2, 2, 2, 2.5)\n },\n boxTitle: {\n margin: 0,\n color: theme.palette.textSubtle\n },\n arrow: {\n color: theme.palette.textSubtle\n }\n }),\n { name: \"BackstageBottomLink\" }\n);\nfunction BottomLink(props) {\n const { link, title, onClick } = props;\n const classes = useStyles();\n return /* @__PURE__ */ jsxs(Box, { children: [\n /* @__PURE__ */ jsx(Divider, {}),\n /* @__PURE__ */ jsx(Link, { to: link, onClick, underline: \"none\", children: /* @__PURE__ */ jsxs(Box, { display: \"flex\", alignItems: \"center\", className: classes.root, children: [\n /* @__PURE__ */ jsx(Box, { className: classes.boxTitle, fontWeight: \"fontWeightBold\", m: 1, children: /* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(\"strong\", { children: title }) }) }),\n /* @__PURE__ */ jsx(ArrowIcon, { className: classes.arrow })\n ] }) })\n ] });\n}\n\nexport { BottomLink };\n//# sourceMappingURL=BottomLink.esm.js.map\n","import { jsx } from 'react/jsx-runtime';\nimport Button$1 from '@material-ui/core/Button';\nimport { forwardRef } from 'react';\nimport { Link } from '../Link/Link.esm.js';\n\nconst LinkWrapper = forwardRef((props, ref) => /* @__PURE__ */ jsx(Link, { ref, ...props, color: \"initial\" }));\nconst LinkButton = forwardRef((props, ref) => /* @__PURE__ */ jsx(Button$1, { ref, component: LinkWrapper, ...props }));\nconst Button = LinkButton;\n\nexport { Button, LinkButton };\n//# sourceMappingURL=LinkButton.esm.js.map\n","import { jsx } from 'react/jsx-runtime';\nimport Typography from '@material-ui/core/Typography';\nimport { Component } from 'react';\nimport { LinkButton } from '../../components/LinkButton/LinkButton.esm.js';\nimport { ErrorPanel } from '../../components/ErrorPanel/ErrorPanel.esm.js';\nimport { coreComponentsTranslationRef } from '../../translation.esm.js';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst SlackLink = (props) => {\n const { slackChannel } = props;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n if (!slackChannel) {\n return null;\n } else if (typeof slackChannel === \"string\") {\n return /* @__PURE__ */ jsx(Typography, { children: t(\"errorBoundary.title\", { slackChannel }) });\n } else if (!slackChannel.href) {\n return /* @__PURE__ */ jsx(Typography, { children: t(\"errorBoundary.title\", {\n slackChannel: slackChannel.name\n }) });\n }\n return /* @__PURE__ */ jsx(LinkButton, { to: slackChannel.href, variant: \"contained\", children: slackChannel.name });\n};\nconst ErrorBoundary = class ErrorBoundary2 extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: void 0,\n errorInfo: void 0\n };\n }\n componentDidCatch(error, errorInfo) {\n console.error(`ErrorBoundary, error: ${error}`, { error, errorInfo });\n this.setState({ error, errorInfo });\n }\n render() {\n const { slackChannel, children } = this.props;\n const { error } = this.state;\n if (!error) {\n return children;\n }\n return /* @__PURE__ */ jsx(ErrorPanel, { title: \"Something Went Wrong\", error, children: /* @__PURE__ */ jsx(SlackLink, { slackChannel }) });\n }\n};\n\nexport { ErrorBoundary };\n//# sourceMappingURL=ErrorBoundary.esm.js.map\n","import { jsx, jsxs } from 'react/jsx-runtime';\nimport Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { BottomLink } from '../BottomLink/BottomLink.esm.js';\nimport { ErrorBoundary } from '../ErrorBoundary/ErrorBoundary.esm.js';\n\nconst useStyles = makeStyles(\n (theme) => ({\n noPadding: {\n padding: 0,\n \"&:last-child\": {\n paddingBottom: 0\n }\n },\n contentAlignBottom: {\n display: \"flex\",\n alignItems: \"self-end\"\n },\n header: {\n padding: theme.spacing(2, 2, 2, 2.5)\n },\n headerTitle: {\n fontWeight: theme.typography.fontWeightBold\n },\n headerSubheader: {\n paddingTop: theme.spacing(1)\n },\n headerAvatar: {},\n headerAction: {},\n headerContent: {},\n subheader: {\n display: \"flex\"\n }\n }),\n { name: \"BackstageInfoCard\" }\n);\nconst CardActionsTopRight = withStyles(\n (theme) => ({\n root: {\n display: \"inline-block\",\n padding: theme.spacing(8, 8, 0, 0),\n float: \"right\"\n }\n }),\n { name: \"BackstageInfoCardCardActionsTopRight\" }\n)(CardActions);\nconst VARIANT_STYLES = {\n card: {\n flex: {\n display: \"flex\",\n flexDirection: \"column\"\n },\n fullHeight: {\n display: \"flex\",\n flexDirection: \"column\",\n height: \"100%\"\n },\n gridItem: {\n display: \"flex\",\n flexDirection: \"column\",\n height: \"calc(100% - 10px)\",\n // for pages without content header\n marginBottom: \"10px\",\n breakInside: \"avoid-page\",\n \"@media print\": {\n height: \"auto\"\n }\n }\n },\n cardContent: {\n fullHeight: {\n flex: 1\n },\n gridItem: {\n flex: 1\n }\n }\n};\nfunction InfoCard(props) {\n const {\n title,\n subheader,\n divider = true,\n deepLink,\n slackChannel,\n errorBoundaryProps,\n variant,\n alignContent = \"normal\",\n children,\n headerStyle,\n headerProps,\n icon,\n action,\n actionsClassName,\n actions,\n cardClassName,\n actionsTopRight,\n className,\n noPadding,\n titleTypographyProps,\n subheaderTypographyProps\n } = props;\n const classes = useStyles();\n let calculatedStyle = {};\n let calculatedCardStyle = {};\n if (variant) {\n const variants = variant.split(/[\\s]+/g);\n variants.forEach((name) => {\n calculatedStyle = {\n ...calculatedStyle,\n ...VARIANT_STYLES.card[name]\n };\n calculatedCardStyle = {\n ...calculatedCardStyle,\n ...VARIANT_STYLES.cardContent[name]\n };\n });\n }\n const cardSubTitle = () => {\n if (!subheader && !icon) {\n return null;\n }\n return /* @__PURE__ */ jsxs(\"div\", { \"data-testid\": \"info-card-subheader\", children: [\n subheader && /* @__PURE__ */ jsx(\"div\", { className: classes.subheader, children: subheader }),\n icon\n ] });\n };\n const errProps = errorBoundaryProps || (slackChannel ? { slackChannel } : {});\n return /* @__PURE__ */ jsx(Card, { style: calculatedStyle, className, children: /* @__PURE__ */ jsxs(ErrorBoundary, { ...errProps, children: [\n title && /* @__PURE__ */ jsx(\n CardHeader,\n {\n classes: {\n root: classNames(classes.header),\n title: classes.headerTitle,\n subheader: classes.headerSubheader,\n avatar: classes.headerAvatar,\n action: classes.headerAction,\n content: classes.headerContent\n },\n title,\n subheader: cardSubTitle(),\n action,\n style: { ...headerStyle },\n titleTypographyProps,\n subheaderTypographyProps,\n ...headerProps\n }\n ),\n actionsTopRight && /* @__PURE__ */ jsx(CardActionsTopRight, { children: actionsTopRight }),\n divider && /* @__PURE__ */ jsx(Divider, {}),\n /* @__PURE__ */ jsx(\n CardContent,\n {\n className: classNames(cardClassName, {\n [classes.noPadding]: noPadding,\n [classes.contentAlignBottom]: alignContent === \"bottom\"\n }),\n style: calculatedCardStyle,\n children\n }\n ),\n actions && /* @__PURE__ */ jsx(CardActions, { className: actionsClassName, children: actions }),\n deepLink && /* @__PURE__ */ jsx(BottomLink, { ...deepLink })\n ] }) });\n}\n\nexport { InfoCard };\n//# sourceMappingURL=InfoCard.esm.js.map\n"],"names":["_interopRequireDefault","_interopRequireWildcard","exports","React","_default","default","createElement","d","useAsync","fn","deps","_a","initialState","loading","lastCallId","useRef","isMounted","useMountedState","useState","state","set","callback","useCallback","args","_i","arguments","length","callId","current","prevState","__assign","apply","then","value","error","useAsyncFn","useEffect","getStatusChipStyle","phase","base","border","backgroundColor","color","useStyles","makeStyles","theme","label","fontWeight","palette","text","secondary","marginBottom","spacing","codeBlock","background","padding","borderRadius","shape","fontFamily","fontSize","overflow","whiteSpace","wordBreak","apiKeyContainer","display","alignItems","gap","tabPanel","marginTop","CodeExample","code","onCopy","classes","Box","position","className","Tooltip","title","IconButton","size","style","top","right","onClick","FileCopyIcon","ApiKeyDetailPage","apiKey","apiProduct","namespace","name","useParams","config","useApi","configApiRef","fetchApi","fetchApiRef","alertApi","alertApiRef","backendUrl","getString","selectedTab","setSelectedTab","showApiKey","setShowApiKey","apiKeyValue","setApiKeyValue","apiKeyLoading","setApiKeyLoading","alreadyRead","setAlreadyRead","showWarning","setShowWarning","data","async","apiKeyData","apiKeyResponse","productsResponse","Promise","all","fetch","ok","Error","json","status","canReadSecret","items","find","p","metadata","spec","apiProductRef","handleCopy","navigator","clipboard","writeText","post","message","severity","Progress","ResponseErrorPanel","statusLabel","hostname","apiHostname","displayApiKey","codeExamples","Page","themeId","Header","subtitle","Link","to","Button","startIcon","ArrowBackIcon","Content","mb","Breadcrumbs","aria-label","Typography","variant","OpenInNewIcon","data-testid","contact","email","url","slack","EmailIcon","href","target","rel","Grid","container","item","xs","md","InfoCard","Chip","planTier","requestedBy","userId","creationTimestamp","Date","toLocaleDateString","reviewedBy","replace","reviewedAt","useCase","mt","VisibilityOffIcon","marginLeft","flex","repeat","span","disabled","VisibilityIcon","Tabs","onChange","_","newValue","indicatorColor","textColor","map","ex","Tab","limits","daily","toLocaleString","weekly","monthly","Dialog","open","onClose","maxWidth","DialogTitle","WarningIcon","marginRight","DialogContent","paragraph","strong","DialogActions","response","err","console","fetchApiKeySecret","root","boxTitle","margin","textSubtle","arrow","BottomLink","props","link","jsxs","children","jsx","Divider","underline","m","A","LinkWrapper","forwardRef","ref","LinkButton","component","SlackLink","slackChannel","t","ErrorBoundary","Component","constructor","super","this","errorInfo","componentDidCatch","setState","render","noPadding","paddingBottom","contentAlignBottom","header","headerTitle","typography","fontWeightBold","headerSubheader","paddingTop","headerAvatar","headerAction","headerContent","subheader","CardActionsTopRight","withStyles","float","CardActions","VARIANT_STYLES","card","flexDirection","fullHeight","height","gridItem","breakInside","cardContent","divider","deepLink","errorBoundaryProps","alignContent","headerStyle","headerProps","icon","action","actionsClassName","actions","cardClassName","actionsTopRight","titleTypographyProps","subheaderTypographyProps","calculatedStyle","calculatedCardStyle","split","forEach","errProps","Card","CardHeader","avatar","content","CardContent"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkinternal_plugin_kuadrant=self.webpackChunkinternal_plugin_kuadrant||[]).push([[3097],{34955:(e,t,a)=>{a.d(t,{Al:()=>s,DS:()=>h,EM:()=>l,FL:()=>i,J:()=>r,KV:()=>A,R_:()=>c,U3:()=>o,dp:()=>u,jH:()=>y,q0:()=>m,uL:()=>g,v_:()=>d,vs:()=>p,z4:()=>v});var n=a(83572);(0,n.i)({name:"kuadrant.planpolicy.create",attributes:{action:"create"}}),(0,n.i)({name:"kuadrant.planpolicy.read",attributes:{action:"read"}}),(0,n.i)({name:"kuadrant.planpolicy.update",attributes:{action:"update"}}),(0,n.i)({name:"kuadrant.planpolicy.delete",attributes:{action:"delete"}});const r=(0,n.i)({name:"kuadrant.planpolicy.list",attributes:{action:"read"}}),i=(0,n.i)({name:"kuadrant.apiproduct.create",attributes:{action:"create"}}),s=((0,n.i)({name:"kuadrant.apiproduct.read.own",attributes:{action:"read"}}),(0,n.i)({name:"kuadrant.apiproduct.read.all",attributes:{action:"read"}})),o=(0,n.i)({name:"kuadrant.apiproduct.update.own",attributes:{action:"update"}}),d=(0,n.i)({name:"kuadrant.apiproduct.update.all",attributes:{action:"update"}}),l=(0,n.i)({name:"kuadrant.apiproduct.delete.own",attributes:{action:"delete"}}),c=(0,n.i)({name:"kuadrant.apiproduct.delete.all",attributes:{action:"delete"}}),p=(0,n.i)({name:"kuadrant.apiproduct.list",attributes:{action:"read"}}),u=(0,n.i)({name:"kuadrant.apikey.create",attributes:{action:"create"},resourceType:"apiproduct"}),h=(0,n.i)({name:"kuadrant.apikey.read.own",attributes:{action:"read"}}),m=((0,n.i)({name:"kuadrant.apikey.read.all",attributes:{action:"read"}}),(0,n.i)({name:"kuadrant.apikey.update.own",attributes:{action:"update"}})),v=(0,n.i)({name:"kuadrant.apikey.update.all",attributes:{action:"update"}}),g=(0,n.i)({name:"kuadrant.apikey.delete.own",attributes:{action:"delete"}}),y=(0,n.i)({name:"kuadrant.apikey.delete.all",attributes:{action:"delete"}}),A=(0,n.i)({name:"kuadrant.apikey.approve",attributes:{action:"update"}})},35015:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(95478),r=a(85608),i=a(71581);function s(e,t){void 0===t&&(t=[]);var a=function(e,t,a){void 0===t&&(t=[]),void 0===a&&(a={loading:!1});var s=(0,n.useRef)(0),o=(0,i.A)(),d=(0,n.useState)(a),l=d[0],c=d[1],p=(0,n.useCallback)(function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];var n=++s.current;return l.loading||c(function(e){return(0,r.__assign)((0,r.__assign)({},e),{loading:!0})}),e.apply(void 0,t).then(function(e){return o()&&n===s.current&&c({value:e,loading:!1}),e},function(e){return o()&&n===s.current&&c({error:e,loading:!1}),e})},t);return[l,p]}(e,t,{loading:!0}),s=a[0],o=a[1];return(0,n.useEffect)(function(){o()},[o]),s}},37725:(e,t,a)=>{a.d(t,{N_:()=>f});var n=a(31085),r=a(22097),i=a(49203),s=a(37976),o=a(72501),d=a(53373),l=a.n(d),c=a(45250),p=a(95478),u=a(42469),h=a(39330);const m=(0,s.makeStyles)(e=>({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",userSelect:"none",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"},externalLinkIcon:{verticalAlign:"bottom",marginLeft:e.spacing(.5)}}),{name:"Link"}),v=()=>{const e=(0,r.useApp)().getSystemIcon("externalLink")||h.A,t=m();return(0,n.jsx)(e,{className:t.externalLinkIcon})},g=e=>/^([a-z+.-]+):/.test(e),y=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,A=window.open;if(A&&!A.__backstage){const e=function(...e){const t=String(e[0]);if(y.test(t))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return A.apply(this,e)};e.__backstage=!0,window.open=e}const x=e=>e instanceof Array?e.map(x).join(" ").trim():"object"==typeof e&&e?x(e?.props?.children):["string","number"].includes(typeof e)?String(e):"",f=(0,p.forwardRef)(({onClick:e,noTrack:t,externalLinkIcon:a,...s},d)=>{const p=m(),h=(0,r.useAnalytics)(),A=function(){const[e]=(0,u.createRoutesFromChildren)((0,n.jsx)(u.Route,{index:!0,element:(0,n.jsx)("div",{})}));return!e.index}()?(e=>{let t=String(e);const a=(()=>{const e=(()=>{try{return(0,r.useApi)(r.configApiRef).getOptionalString("app.baseUrl")}catch{return}})()??"/",{pathname:t}=new URL(e,"http://sample.dev");return(0,c.trimEnd)(t,"/")})(),n=g(t),i=t.startsWith(a);return n||i||(t=a.concat(t)),t})(s.to):s.to,f=x(s.children)||A,j=g(A),b=j&&!!/^https?:/.exec(A);if(y.test(A))throw new Error("Link component rejected javascript: URL as a security precaution");const k=a=>{e?.(a),t||h.captureEvent("click",f,{attributes:{to:A}})};return j?(0,n.jsxs)(i.A,{...b?{target:"_blank",rel:"noopener"}:{},...s,...s["aria-label"]?{"aria-label":`${s["aria-label"]}, Opens in a new window`}:{},ref:d,href:A,onClick:k,className:l()(p.externalLink,s.className),children:[s.children,a&&(0,n.jsx)(v,{}),(0,n.jsx)(o.A,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(i.A,{...s,ref:d,component:u.Link,to:A,onClick:k})})},39330:(e,t,a)=>{var n=a(4293),r=a(78920);t.A=void 0;var i=r(a(95478)),s=(0,n(a(74044)).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");t.A=s},43097:(e,t,a)=>{a.r(t),a.d(t,{ApprovalQueueCard:()=>B});var n=a(31085),r=a(95478),i=a(22097),s=a(35015),o=a(86687),d=a(42367),l=a(96040),c=a(25010),p=a(34955),u=a(46205),h=a(76891),m=a(61477),v=a(46805),g=a(10394),y=a(72501),A=a(93453),x=a(64947),f=a(78467),j=a(67720),b=a(71677),k=a(31653),w=a(38605),C=a(8973),q=a(29655),R=a(91567),S=a(55429),P=a(92399),I=a(6924);const T=({open:e,request:t,action:a,processing:r,onClose:i,onConfirm:s})=>{var o;const d="approve"===a?"Approve":"Reject",l="approve"===a?"Approving...":"Rejecting...";return(0,n.jsxs)(h.A,{open:e,onClose:r?void 0:i,maxWidth:"sm",fullWidth:!0,children:[(0,n.jsxs)(m.A,{children:[d," API Key"]}),(0,n.jsx)(v.A,{children:t&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:"User:"})," ",t.spec.requestedBy.userId]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:"API:"})," ",(null===(o=t.spec.apiProductRef)||void 0===o?void 0:o.name)||"unknown"]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:"Tier:"})," ",t.spec.planTier]}),(0,n.jsxs)(g.A,{mb:2,children:[(0,n.jsx)(y.A,{variant:"body2",component:"span",style:{fontWeight:"bold"},children:"Use Case:"})," ",(0,n.jsx)(y.A,{variant:"body2",component:"span",style:{whiteSpace:"pre-wrap"},children:t.spec.useCase||"-"})]})]})}),(0,n.jsxs)(A.A,{children:[(0,n.jsx)(x.A,{onClick:i,disabled:r,children:"Cancel"}),(0,n.jsx)(x.A,{onClick:s,color:"approve"===a?"primary":"secondary",variant:"contained",disabled:r,startIcon:r?(0,n.jsx)(f.A,{size:16,color:"inherit"}):void 0,children:r?l:d})]})]})},$=({open:e,requests:t,action:a,processing:r,onClose:i,onConfirm:s})=>{const o="approve"===a,d=o?"Approve All":"Reject All",l=o?"Approving...":"Rejecting...";return(0,n.jsxs)(h.A,{open:e,onClose:r?void 0:i,maxWidth:"md",fullWidth:!0,children:[(0,n.jsxs)(m.A,{children:[o?"Approve":"Reject"," ",t.length," API Keys"]}),(0,n.jsxs)(v.A,{children:[(0,n.jsxs)(y.A,{variant:"body2",paragraph:!0,children:["You are about to ",o?"approve":"reject"," the following API keys:"]}),(0,n.jsx)(g.A,{mb:2,maxHeight:200,overflow:"auto",children:t.map(e=>{var t;return(0,n.jsx)(g.A,{mb:1,p:1,bgcolor:"background.default",children:(0,n.jsxs)(y.A,{variant:"body2",children:[(0,n.jsx)("strong",{children:e.spec.requestedBy.userId})," -"," ",(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"," (",e.spec.planTier,")"]})},`${e.metadata.namespace}/${e.metadata.name}`)})})]}),(0,n.jsxs)(A.A,{children:[(0,n.jsx)(x.A,{onClick:i,disabled:r,children:"Cancel"}),(0,n.jsx)(x.A,{onClick:s,color:o?"primary":"secondary",variant:"contained",disabled:r,startIcon:r?(0,n.jsx)(f.A,{size:16,color:"inherit"}):void 0,children:r?l:d})]})]})},B=()=>{const e=(0,i.useApi)(i.configApiRef),t=(0,i.useApi)(i.fetchApiRef),a=(0,i.useApi)(i.identityApiRef),h=(0,i.useApi)(i.alertApiRef),m=e.getString("backend.baseUrl"),[v,A]=(0,r.useState)(0),[f,B]=(0,r.useState)(0),[N,L]=(0,r.useState)([]),[z,_]=(0,r.useState)({open:!1,request:null,action:"approve",processing:!1}),[E,W]=(0,r.useState)({open:!1,requests:[],action:"approve",processing:!1}),{allowed:U,loading:O,error:H}=(0,u.l)(p.z4),{allowed:D,loading:F,error:M}=(0,u.l)(p.q0),Q=O||F,V=H||M,{value:J,loading:K,error:G}=(0,s.A)(async()=>{const e=(await a.getBackstageIdentity()).userEntityRef;console.log("ApprovalQueueCard: fetching all requests from",`${m}/api/kuadrant/requests`);const[n,r]=await Promise.all([t.fetch(`${m}/api/kuadrant/requests`),t.fetch(`${m}/api/kuadrant/apiproducts`)]);if(!n.ok)return console.log("ApprovalQueueCard: failed to fetch requests, status:",n.status),{pending:[],approved:[],rejected:[],reviewedBy:e,ownedApiProducts:new Set};const i=n.headers.get("content-type");if(!(null==i?void 0:i.includes("application/json")))return console.error("ApprovalQueueCard: received non-json response"),h.post({message:"Unexpected content-type from the server response. Please contact support.",display:"transient",severity:"warning"}),{pending:[],approved:[],rejected:[],reviewedBy:e,ownedApiProducts:new Set};const s=(await n.json()).items||[],o=new Set;if(r.ok){const t=await r.json();for(const a of t.items||[]){var d,l;(null===(l=a.metadata)||void 0===l||null===(d=l.annotations)||void 0===d?void 0:d["backstage.io/owner"])===e&&o.add(`${a.metadata.namespace}/${a.metadata.name}`)}}console.log("ApprovalQueueCard: received",s.length,"total requests"),console.log("ApprovalQueueCard: user owns",o.size,"api products");const c=s.filter(e=>{var t;return"Pending"===((null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending")}),p=s.filter(e=>{var t;return"Approved"===(null===(t=e.status)||void 0===t?void 0:t.phase)}),u=s.filter(e=>{var t;return"Rejected"===(null===(t=e.status)||void 0===t?void 0:t.phase)});return console.log("ApprovalQueueCard: grouped -",{pending:c.length,approved:p.length,rejected:u.length}),{pending:c,approved:p,rejected:u,reviewedBy:e,ownedApiProducts:o}},[m,t,a,v]);if(K||Q)return(0,n.jsx)(o.k,{});if(G)return(0,n.jsx)(d._,{error:G});if(V)return(0,n.jsxs)(g.A,{p:2,children:[(0,n.jsxs)(y.A,{color:"error",children:["Unable to check permissions: ",V.message]}),(0,n.jsx)(y.A,{variant:"body2",color:"textSecondary",children:"Permission: kuadrant.apikey.update.all"}),(0,n.jsx)(y.A,{variant:"body2",color:"textSecondary",children:"Please try again or contact your administrator"})]});const X=(null==J?void 0:J.pending)||[],Y=(null==J?void 0:J.approved)||[],Z=(null==J?void 0:J.rejected)||[],ee=e=>new Date(e).toLocaleDateString("en-GB",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),te=[{title:"Name",field:"metadata.name",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.name})},{title:"User",field:"spec.requestedBy.userId",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.spec.requestedBy.userId})},{title:"API",field:"spec.apiProductRef.name",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(0,n.jsx)("strong",{children:(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"})})}},{title:"Namespace",field:"metadata.namespace",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.namespace})},{title:"Tier",field:"spec.planTier",render:e=>(0,n.jsx)(j.A,{label:e.spec.planTier,size:"small"})},{title:"Use Case",field:"spec.useCase",render:e=>e.spec.useCase?(0,n.jsx)(b.Ay,{title:e.spec.useCase,placement:"top",children:(0,n.jsx)(y.A,{variant:"body2",style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.spec.useCase})}):(0,n.jsx)(y.A,{variant:"body2",children:"-"})},{title:"Requested",field:"metadata.creationTimestamp",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.creationTimestamp?ee(e.metadata.creationTimestamp):"-"})},{title:"Actions",filtering:!1,render:e=>{var t,a;const r=`${e.metadata.namespace}/${(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"}`;var i;const s=null!==(i=null==J||null===(a=J.ownedApiProducts)||void 0===a?void 0:a.has(r))&&void 0!==i&&i;return U||D&&s?(0,n.jsxs)(g.A,{display:"flex",style:{gap:8},children:[(0,n.jsx)(x.A,{size:"small",startIcon:(0,n.jsx)(S.A,{}),onClick:()=>{_({open:!0,request:e,action:"approve",processing:!1})},color:"primary",variant:"outlined",children:"Approve"}),(0,n.jsx)(x.A,{size:"small",startIcon:(0,n.jsx)(P.A,{}),onClick:()=>{_({open:!0,request:e,action:"reject",processing:!1})},color:"secondary",variant:"outlined",children:"Reject"})]}):null}}],ae=[{title:"Name",field:"metadata.name",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.name})},{title:"User",field:"spec.requestedBy.userId",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.spec.requestedBy.userId})},{title:"API",field:"spec.apiProductRef.name",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(0,n.jsx)("strong",{children:(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"})})}},{title:"Namespace",field:"metadata.namespace",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.namespace})},{title:"Tier",field:"spec.planTier",render:e=>(0,n.jsx)(j.A,{label:e.spec.planTier,size:"small"})},{title:"Requested",field:"metadata.creationTimestamp",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.creationTimestamp?ee(e.metadata.creationTimestamp):"-"})},{title:"Approved",field:"status.reviewedAt",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(null===(t=e.status)||void 0===t?void 0:t.reviewedAt)?ee(e.status.reviewedAt):"-"})}},{title:"Reviewed By",field:"status.reviewedBy",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(null===(t=e.status)||void 0===t?void 0:t.reviewedBy)||"-"})}},{title:"Approval Type",field:"status.reviewedBy",render:e=>{var t;const a="system"===(null===(t=e.status)||void 0===t?void 0:t.reviewedBy);return(0,n.jsx)(j.A,{label:a?"Automatic":"Manual",size:"small",color:a?"default":"primary"})}}],ne=[{title:"Name",field:"metadata.name",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.name})},{title:"User",field:"spec.requestedBy.userId",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.spec.requestedBy.userId})},{title:"API",field:"spec.apiProductRef.name",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(0,n.jsx)("strong",{children:(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"})})}},{title:"Namespace",field:"metadata.namespace",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.namespace})},{title:"Tier",field:"spec.planTier",render:e=>(0,n.jsx)(j.A,{label:e.spec.planTier,size:"small"})},{title:"Requested",field:"metadata.creationTimestamp",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.creationTimestamp?ee(e.metadata.creationTimestamp):"-"})},{title:"Rejected",field:"status.reviewedAt",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(null===(t=e.status)||void 0===t?void 0:t.reviewedAt)?ee(e.status.reviewedAt):"-"})}},{title:"Reviewed By",field:"status.reviewedBy",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(null===(t=e.status)||void 0===t?void 0:t.reviewedBy)||"-"})}}],re=(()=>{const e=e=>e.map(e=>({...e,id:e.metadata.name}));switch(f){case 0:return{data:X.map(e=>{const t=N.some(t=>t.metadata.name===e.metadata.name&&t.metadata.namespace===e.metadata.namespace);return{...e,tableData:{checked:t}}}),columns:te,showSelection:!0};case 1:return{data:e(Y),columns:ae,showSelection:!1};case 2:return{data:e(Z),columns:ne,showSelection:!1};default:return{data:e(X),columns:te,showSelection:!0}}})(),ie=(e=>{const t=new Map;return e.forEach(e=>{var a;const n=`${e.metadata.namespace}/${(null===(a=e.spec.apiProductRef)||void 0===a?void 0:a.name)||"unknown"}`;t.has(n)||t.set(n,[]),t.get(n).push(e)}),t})(re.data),se=Array.from(ie.keys()).sort();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.n,{title:"API Access Requests",subheader:`${X.length} pending, ${Y.length} approved, ${Z.length} rejected`,children:[(0,n.jsx)(g.A,{mb:2,"data-testid":"approval-queue-card",children:(0,n.jsxs)(k.A,{value:f,onChange:(e,t)=>{B(t),L([])},indicatorColor:"primary",textColor:"primary","data-testid":"approval-queue-tabs",children:[(0,n.jsx)(w.A,{label:`Pending (${X.length})`,"data-testid":"approval-queue-pending-tab"}),(0,n.jsx)(w.A,{label:`Approved (${Y.length})`,"data-testid":"approval-queue-approved-tab"}),(0,n.jsx)(w.A,{label:`Rejected (${Z.length})`,"data-testid":"approval-queue-rejected-tab"})]})}),0===f&&N.length>0&&(0,n.jsxs)(g.A,{mb:2,display:"flex",alignItems:"center",justifyContent:"space-between",p:2,bgcolor:"background.default",children:[(0,n.jsxs)(y.A,{variant:"body2",children:[N.length," request",1!==N.length?"s":""," selected"]}),(0,n.jsxs)(g.A,{display:"flex",style:{gap:8},children:[(0,n.jsx)(x.A,{size:"small",variant:"contained",color:"primary",startIcon:(0,n.jsx)(S.A,{}),onClick:()=>{0!==N.length&&W({open:!0,requests:N,action:"approve",processing:!1})},children:"Approve Selected"}),(0,n.jsx)(x.A,{size:"small",variant:"contained",color:"secondary",startIcon:(0,n.jsx)(P.A,{}),onClick:()=>{0!==N.length&&W({open:!0,requests:N,action:"reject",processing:!1})},children:"Reject Selected"})]})]}),0===re.data.length?(0,n.jsx)(g.A,{p:3,textAlign:"center",children:(0,n.jsxs)(y.A,{variant:"body1",color:"textSecondary",children:[0===f&&"No pending requests.",1===f&&"No approved requests.",2===f&&"No rejected requests."]})}):(0,n.jsx)(g.A,{children:se.map(e=>{var t,a,r;const i=ie.get(e)||[],s=(null===(a=i[0])||void 0===a||null===(t=a.spec.apiProductRef)||void 0===t?void 0:t.name)||e;var o;const d=null!==(o=null==J||null===(r=J.ownedApiProducts)||void 0===r?void 0:r.has(e))&&void 0!==o&&o,l=U||D&&d;return(0,n.jsxs)(C.A,{defaultExpanded:1===se.length,children:[(0,n.jsx)(q.A,{expandIcon:(0,n.jsx)(I.A,{}),children:(0,n.jsxs)(g.A,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",children:[(0,n.jsx)(y.A,{variant:"h6",children:s}),(0,n.jsx)(j.A,{label:`${i.length} request${1!==i.length?"s":""}`,size:"small",color:"primary",style:{marginRight:16}})]})}),(0,n.jsx)(R.A,{children:(0,n.jsx)(g.A,{width:"100%",children:(0,n.jsx)(c.X,{options:{selection:l&&re.showSelection,paging:i.length>5,pageSize:20,search:!0,filtering:!0,debounceInterval:300,showTextRowsSelected:!1,toolbar:!0,emptyRowsWhenPaging:!1},data:i,columns:re.columns,onSelectionChange:t=>{const a=N.filter(t=>{var a;return`${t.metadata.namespace}/${(null===(a=t.spec.apiProductRef)||void 0===a?void 0:a.name)||"unknown"}`!==e});L([...a,...t])}})})})]},e)})})]}),(0,n.jsx)(T,{open:z.open,request:z.request,action:z.action,processing:z.processing,onClose:()=>_({open:!1,request:null,action:"approve",processing:!1}),onConfirm:async()=>{if(!z.request||!J)return;_(e=>({...e,processing:!0}));const e="approve"===z.action?`${m}/api/kuadrant/requests/${z.request.metadata.namespace}/${z.request.metadata.name}/approve`:`${m}/api/kuadrant/requests/${z.request.metadata.namespace}/${z.request.metadata.name}/reject`;try{if(!(await t.fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviewedBy:J.reviewedBy})})).ok)throw new Error(`failed to ${z.action} request`);_({open:!1,request:null,action:"approve",processing:!1}),A(e=>e+1);const a="approve"===z.action?"approved":"rejected";h.post({message:`API key ${a}`,severity:"success",display:"transient"})}catch(e){console.error(`error ${z.action}ing request:`,e),_(e=>({...e,processing:!1})),h.post({message:`Failed to ${z.action} API key`,severity:"error",display:"transient"})}}}),(0,n.jsx)($,{open:E.open,requests:E.requests,action:E.action,processing:E.processing,onClose:()=>W({open:!1,requests:[],action:"approve",processing:!1}),onConfirm:async()=>{if(!J||0===E.requests.length)return;W(e=>({...e,processing:!0}));const e="approve"===E.action,a=e?`${m}/api/kuadrant/requests/bulk-approve`:`${m}/api/kuadrant/requests/bulk-reject`;try{if(!(await t.fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requests:E.requests.map(e=>({namespace:e.metadata.namespace,name:e.metadata.name})),reviewedBy:J.reviewedBy})})).ok)throw new Error(`failed to bulk ${E.action} requests`);const n=E.requests.length,r=e?"approved":"rejected";W({open:!1,requests:[],action:"approve",processing:!1}),L([]),A(e=>e+1),h.post({message:`${n} API keys ${r}`,severity:"success",display:"transient"})}catch(e){console.error(`error bulk ${E.action}ing requests:`,e),W(e=>({...e,processing:!1})),h.post({message:`Failed to bulk ${E.action} API keys`,severity:"error",display:"transient"})}}})]})}},46205:(e,t,a)=>{a.d(t,{W:()=>i,l:()=>r});var n=a(87421);function r(e,t){const a="resourceType"in e?{permission:e,resourceRef:t}:{permission:e},r=(0,n.J)(a);return{allowed:r.allowed,loading:r.loading,error:r.error}}function i(e,t,a,n){return!!n||!(!a||e!==t)}},52235:(e,t,a)=>{var n=a(4293),r=a(78920);t.A=void 0;var i=r(a(95478)),s=(0,n(a(74044)).default)(i.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward");t.A=s},55429:(e,t,a)=>{var n=a(4293),r=a(78920);t.A=void 0;var i=r(a(95478)),s=(0,n(a(74044)).default)(i.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");t.A=s},96040:(e,t,a)=>{a.d(t,{n:()=>I});var n=a(31085),r=a(40703),i=a(59469),s=a(48653),o=a(45685),d=a(37197),l=a(37976),c=a(53373),p=a.n(c),u=a(10394),h=a(72501),m=a(52235),v=a(37725);const g=(0,l.makeStyles)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function y(e){const{link:t,title:a,onClick:r}=e,i=g();return(0,n.jsxs)(u.A,{children:[(0,n.jsx)(d.A,{}),(0,n.jsx)(v.N_,{to:t,onClick:r,underline:"none",children:(0,n.jsxs)(u.A,{display:"flex",alignItems:"center",className:i.root,children:[(0,n.jsx)(u.A,{className:i.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(h.A,{children:(0,n.jsx)("strong",{children:a})})}),(0,n.jsx)(m.A,{className:i.arrow})]})})]})}var A=a(95478),x=a(64947);const f=(0,A.forwardRef)((e,t)=>(0,n.jsx)(v.N_,{ref:t,...e,color:"initial"})),j=(0,A.forwardRef)((e,t)=>(0,n.jsx)(x.A,{ref:t,component:f,...e}));var b=a(34169),k=a(16098),w=a(67550);const C=e=>{const{slackChannel:t}=e,{t:a}=(0,w.i)(k.O);return t?"string"==typeof t?(0,n.jsx)(h.A,{children:a("errorBoundary.title",{slackChannel:t})}):t.href?(0,n.jsx)(j,{to:t.href,variant:"contained",children:t.name}):(0,n.jsx)(h.A,{children:a("errorBoundary.title",{slackChannel:t.name})}):null},q=class extends A.Component{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(e,t){console.error(`ErrorBoundary, error: ${e}`,{error:e,errorInfo:t}),this.setState({error:e,errorInfo:t})}render(){const{slackChannel:e,children:t}=this.props,{error:a}=this.state;return a?(0,n.jsx)(b.b,{title:"Something Went Wrong",error:a,children:(0,n.jsx)(C,{slackChannel:e})}):t}},R=(0,l.makeStyles)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),S=(0,l.withStyles)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(i.A),P={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function I(e){const{title:t,subheader:a,divider:l=!0,deepLink:c,slackChannel:u,errorBoundaryProps:h,variant:m,alignContent:v="normal",children:g,headerStyle:A,headerProps:x,icon:f,action:j,actionsClassName:b,actions:k,cardClassName:w,actionsTopRight:C,className:I,noPadding:T,titleTypographyProps:$,subheaderTypographyProps:B}=e,N=R();let L={},z={};m&&m.split(/[\s]+/g).forEach(e=>{L={...L,...P.card[e]},z={...z,...P.cardContent[e]}});const _=h||(u?{slackChannel:u}:{});return(0,n.jsx)(r.A,{style:L,className:I,children:(0,n.jsxs)(q,{..._,children:[t&&(0,n.jsx)(o.A,{classes:{root:p()(N.header),title:N.headerTitle,subheader:N.headerSubheader,avatar:N.headerAvatar,action:N.headerAction,content:N.headerContent},title:t,subheader:a||f?(0,n.jsxs)("div",{"data-testid":"info-card-subheader",children:[a&&(0,n.jsx)("div",{className:N.subheader,children:a}),f]}):null,action:j,style:{...A},titleTypographyProps:$,subheaderTypographyProps:B,...x}),C&&(0,n.jsx)(S,{children:C}),l&&(0,n.jsx)(d.A,{}),(0,n.jsx)(s.A,{className:p()(w,{[N.noPadding]:T,[N.contentAlignBottom]:"bottom"===v}),style:z,children:g}),k&&(0,n.jsx)(i.A,{className:b,children:k}),c&&(0,n.jsx)(y,{...c})]})})}}}]);
|
|
2
|
-
//# sourceMappingURL=3097.
|
|
1
|
+
"use strict";(self.webpackChunkinternal_plugin_kuadrant=self.webpackChunkinternal_plugin_kuadrant||[]).push([[3097],{34955:(e,t,a)=>{a.d(t,{Al:()=>s,DS:()=>h,EM:()=>l,FL:()=>i,J:()=>r,KV:()=>A,R_:()=>c,U3:()=>o,dp:()=>u,jH:()=>y,q0:()=>m,uL:()=>g,v_:()=>d,vs:()=>p,z4:()=>v});var n=a(83572);(0,n.i)({name:"kuadrant.planpolicy.create",attributes:{action:"create"}}),(0,n.i)({name:"kuadrant.planpolicy.read",attributes:{action:"read"}}),(0,n.i)({name:"kuadrant.planpolicy.update",attributes:{action:"update"}}),(0,n.i)({name:"kuadrant.planpolicy.delete",attributes:{action:"delete"}});const r=(0,n.i)({name:"kuadrant.planpolicy.list",attributes:{action:"read"}}),i=(0,n.i)({name:"kuadrant.apiproduct.create",attributes:{action:"create"}}),s=((0,n.i)({name:"kuadrant.apiproduct.read.own",attributes:{action:"read"}}),(0,n.i)({name:"kuadrant.apiproduct.read.all",attributes:{action:"read"}})),o=(0,n.i)({name:"kuadrant.apiproduct.update.own",attributes:{action:"update"}}),d=(0,n.i)({name:"kuadrant.apiproduct.update.all",attributes:{action:"update"}}),l=(0,n.i)({name:"kuadrant.apiproduct.delete.own",attributes:{action:"delete"}}),c=(0,n.i)({name:"kuadrant.apiproduct.delete.all",attributes:{action:"delete"}}),p=(0,n.i)({name:"kuadrant.apiproduct.list",attributes:{action:"read"}}),u=(0,n.i)({name:"kuadrant.apikey.create",attributes:{action:"create"},resourceType:"apiproduct"}),h=(0,n.i)({name:"kuadrant.apikey.read.own",attributes:{action:"read"}}),m=((0,n.i)({name:"kuadrant.apikey.read.all",attributes:{action:"read"}}),(0,n.i)({name:"kuadrant.apikey.update.own",attributes:{action:"update"}})),v=(0,n.i)({name:"kuadrant.apikey.update.all",attributes:{action:"update"}}),g=(0,n.i)({name:"kuadrant.apikey.delete.own",attributes:{action:"delete"}}),y=(0,n.i)({name:"kuadrant.apikey.delete.all",attributes:{action:"delete"}}),A=(0,n.i)({name:"kuadrant.apikey.approve",attributes:{action:"update"}})},35015:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(95478),r=a(85608),i=a(71581);function s(e,t){void 0===t&&(t=[]);var a=function(e,t,a){void 0===t&&(t=[]),void 0===a&&(a={loading:!1});var s=(0,n.useRef)(0),o=(0,i.A)(),d=(0,n.useState)(a),l=d[0],c=d[1],p=(0,n.useCallback)(function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];var n=++s.current;return l.loading||c(function(e){return(0,r.__assign)((0,r.__assign)({},e),{loading:!0})}),e.apply(void 0,t).then(function(e){return o()&&n===s.current&&c({value:e,loading:!1}),e},function(e){return o()&&n===s.current&&c({error:e,loading:!1}),e})},t);return[l,p]}(e,t,{loading:!0}),s=a[0],o=a[1];return(0,n.useEffect)(function(){o()},[o]),s}},37725:(e,t,a)=>{a.d(t,{N_:()=>f});var n=a(31085),r=a(22097),i=a(49203),s=a(37976),o=a(72501),d=a(53373),l=a.n(d),c=a(45250),p=a(95478),u=a(49634),h=a(39330);const m=(0,s.makeStyles)(e=>({visuallyHidden:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",position:"absolute",userSelect:"none",whiteSpace:"nowrap",height:1,width:1},externalLink:{position:"relative"},externalLinkIcon:{verticalAlign:"bottom",marginLeft:e.spacing(.5)}}),{name:"Link"}),v=()=>{const e=(0,r.useApp)().getSystemIcon("externalLink")||h.A,t=m();return(0,n.jsx)(e,{className:t.externalLinkIcon})},g=e=>/^([a-z+.-]+):/.test(e),y=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i,A=window.open;if(A&&!A.__backstage){const e=function(...e){const t=String(e[0]);if(y.test(t))throw new Error("Rejected window.open() with a javascript: URL as a security precaution");return A.apply(this,e)};e.__backstage=!0,window.open=e}const x=e=>e instanceof Array?e.map(x).join(" ").trim():"object"==typeof e&&e?x(e?.props?.children):["string","number"].includes(typeof e)?String(e):"",f=(0,p.forwardRef)(({onClick:e,noTrack:t,externalLinkIcon:a,...s},d)=>{const p=m(),h=(0,r.useAnalytics)(),A=function(){const[e]=(0,u.createRoutesFromChildren)((0,n.jsx)(u.Route,{index:!0,element:(0,n.jsx)("div",{})}));return!e.index}()?(e=>{let t=String(e);const a=(()=>{const e=(()=>{try{return(0,r.useApi)(r.configApiRef).getOptionalString("app.baseUrl")}catch{return}})()??"/",{pathname:t}=new URL(e,"http://sample.dev");return(0,c.trimEnd)(t,"/")})(),n=g(t),i=t.startsWith(a);return n||i||(t=a.concat(t)),t})(s.to):s.to,f=x(s.children)||A,j=g(A),b=j&&!!/^https?:/.exec(A);if(y.test(A))throw new Error("Link component rejected javascript: URL as a security precaution");const k=a=>{e?.(a),t||h.captureEvent("click",f,{attributes:{to:A}})};return j?(0,n.jsxs)(i.A,{...b?{target:"_blank",rel:"noopener"}:{},...s,...s["aria-label"]?{"aria-label":`${s["aria-label"]}, Opens in a new window`}:{},ref:d,href:A,onClick:k,className:l()(p.externalLink,s.className),children:[s.children,a&&(0,n.jsx)(v,{}),(0,n.jsx)(o.A,{component:"span",className:p.visuallyHidden,children:", Opens in a new window"})]}):(0,n.jsx)(i.A,{...s,ref:d,component:u.Link,to:A,onClick:k})})},39330:(e,t,a)=>{var n=a(4293),r=a(78920);t.A=void 0;var i=r(a(95478)),s=(0,n(a(74044)).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");t.A=s},43097:(e,t,a)=>{a.r(t),a.d(t,{ApprovalQueueCard:()=>B});var n=a(31085),r=a(95478),i=a(22097),s=a(35015),o=a(86687),d=a(42367),l=a(96040),c=a(25010),p=a(34955),u=a(46205),h=a(76891),m=a(61477),v=a(46805),g=a(10394),y=a(72501),A=a(93453),x=a(64947),f=a(78467),j=a(67720),b=a(71677),k=a(31653),w=a(38605),C=a(8973),q=a(29655),R=a(91567),S=a(55429),P=a(92399),I=a(6924);const T=({open:e,request:t,action:a,processing:r,onClose:i,onConfirm:s})=>{var o;const d="approve"===a?"Approve":"Reject",l="approve"===a?"Approving...":"Rejecting...";return(0,n.jsxs)(h.A,{open:e,onClose:r?void 0:i,maxWidth:"sm",fullWidth:!0,children:[(0,n.jsxs)(m.A,{children:[d," API Key"]}),(0,n.jsx)(v.A,{children:t&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:"User:"})," ",t.spec.requestedBy.userId]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:"API:"})," ",(null===(o=t.spec.apiProductRef)||void 0===o?void 0:o.name)||"unknown"]}),(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:"Tier:"})," ",t.spec.planTier]}),(0,n.jsxs)(g.A,{mb:2,children:[(0,n.jsx)(y.A,{variant:"body2",component:"span",style:{fontWeight:"bold"},children:"Use Case:"})," ",(0,n.jsx)(y.A,{variant:"body2",component:"span",style:{whiteSpace:"pre-wrap"},children:t.spec.useCase||"-"})]})]})}),(0,n.jsxs)(A.A,{children:[(0,n.jsx)(x.A,{onClick:i,disabled:r,children:"Cancel"}),(0,n.jsx)(x.A,{onClick:s,color:"approve"===a?"primary":"secondary",variant:"contained",disabled:r,startIcon:r?(0,n.jsx)(f.A,{size:16,color:"inherit"}):void 0,children:r?l:d})]})]})},$=({open:e,requests:t,action:a,processing:r,onClose:i,onConfirm:s})=>{const o="approve"===a,d=o?"Approve All":"Reject All",l=o?"Approving...":"Rejecting...";return(0,n.jsxs)(h.A,{open:e,onClose:r?void 0:i,maxWidth:"md",fullWidth:!0,children:[(0,n.jsxs)(m.A,{children:[o?"Approve":"Reject"," ",t.length," API Keys"]}),(0,n.jsxs)(v.A,{children:[(0,n.jsxs)(y.A,{variant:"body2",paragraph:!0,children:["You are about to ",o?"approve":"reject"," the following API keys:"]}),(0,n.jsx)(g.A,{mb:2,maxHeight:200,overflow:"auto",children:t.map(e=>{var t;return(0,n.jsx)(g.A,{mb:1,p:1,bgcolor:"background.default",children:(0,n.jsxs)(y.A,{variant:"body2",children:[(0,n.jsx)("strong",{children:e.spec.requestedBy.userId})," -"," ",(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"," (",e.spec.planTier,")"]})},`${e.metadata.namespace}/${e.metadata.name}`)})})]}),(0,n.jsxs)(A.A,{children:[(0,n.jsx)(x.A,{onClick:i,disabled:r,children:"Cancel"}),(0,n.jsx)(x.A,{onClick:s,color:o?"primary":"secondary",variant:"contained",disabled:r,startIcon:r?(0,n.jsx)(f.A,{size:16,color:"inherit"}):void 0,children:r?l:d})]})]})},B=()=>{const e=(0,i.useApi)(i.configApiRef),t=(0,i.useApi)(i.fetchApiRef),a=(0,i.useApi)(i.identityApiRef),h=(0,i.useApi)(i.alertApiRef),m=e.getString("backend.baseUrl"),[v,A]=(0,r.useState)(0),[f,B]=(0,r.useState)(0),[N,L]=(0,r.useState)([]),[z,_]=(0,r.useState)({open:!1,request:null,action:"approve",processing:!1}),[E,W]=(0,r.useState)({open:!1,requests:[],action:"approve",processing:!1}),{allowed:U,loading:O,error:H}=(0,u.l)(p.z4),{allowed:D,loading:F,error:M}=(0,u.l)(p.q0),Q=O||F,V=H||M,{value:J,loading:K,error:G}=(0,s.A)(async()=>{const e=(await a.getBackstageIdentity()).userEntityRef;console.log("ApprovalQueueCard: fetching all requests from",`${m}/api/kuadrant/requests`);const[n,r]=await Promise.all([t.fetch(`${m}/api/kuadrant/requests`),t.fetch(`${m}/api/kuadrant/apiproducts`)]);if(!n.ok)return console.log("ApprovalQueueCard: failed to fetch requests, status:",n.status),{pending:[],approved:[],rejected:[],reviewedBy:e,ownedApiProducts:new Set};const i=n.headers.get("content-type");if(!(null==i?void 0:i.includes("application/json")))return console.error("ApprovalQueueCard: received non-json response"),h.post({message:"Unexpected content-type from the server response. Please contact support.",display:"transient",severity:"warning"}),{pending:[],approved:[],rejected:[],reviewedBy:e,ownedApiProducts:new Set};const s=(await n.json()).items||[],o=new Set;if(r.ok){const t=await r.json();for(const a of t.items||[]){var d,l;(null===(l=a.metadata)||void 0===l||null===(d=l.annotations)||void 0===d?void 0:d["backstage.io/owner"])===e&&o.add(`${a.metadata.namespace}/${a.metadata.name}`)}}console.log("ApprovalQueueCard: received",s.length,"total requests"),console.log("ApprovalQueueCard: user owns",o.size,"api products");const c=s.filter(e=>{var t;return"Pending"===((null===(t=e.status)||void 0===t?void 0:t.phase)||"Pending")}),p=s.filter(e=>{var t;return"Approved"===(null===(t=e.status)||void 0===t?void 0:t.phase)}),u=s.filter(e=>{var t;return"Rejected"===(null===(t=e.status)||void 0===t?void 0:t.phase)});return console.log("ApprovalQueueCard: grouped -",{pending:c.length,approved:p.length,rejected:u.length}),{pending:c,approved:p,rejected:u,reviewedBy:e,ownedApiProducts:o}},[m,t,a,v]);if(K||Q)return(0,n.jsx)(o.k,{});if(G)return(0,n.jsx)(d._,{error:G});if(V)return(0,n.jsxs)(g.A,{p:2,children:[(0,n.jsxs)(y.A,{color:"error",children:["Unable to check permissions: ",V.message]}),(0,n.jsx)(y.A,{variant:"body2",color:"textSecondary",children:"Permission: kuadrant.apikey.update.all"}),(0,n.jsx)(y.A,{variant:"body2",color:"textSecondary",children:"Please try again or contact your administrator"})]});const X=(null==J?void 0:J.pending)||[],Y=(null==J?void 0:J.approved)||[],Z=(null==J?void 0:J.rejected)||[],ee=e=>new Date(e).toLocaleDateString("en-GB",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),te=[{title:"Name",field:"metadata.name",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.name})},{title:"User",field:"spec.requestedBy.userId",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.spec.requestedBy.userId})},{title:"API",field:"spec.apiProductRef.name",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(0,n.jsx)("strong",{children:(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"})})}},{title:"Namespace",field:"metadata.namespace",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.namespace})},{title:"Tier",field:"spec.planTier",render:e=>(0,n.jsx)(j.A,{label:e.spec.planTier,size:"small"})},{title:"Use Case",field:"spec.useCase",render:e=>e.spec.useCase?(0,n.jsx)(b.Ay,{title:e.spec.useCase,placement:"top",children:(0,n.jsx)(y.A,{variant:"body2",style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.spec.useCase})}):(0,n.jsx)(y.A,{variant:"body2",children:"-"})},{title:"Requested",field:"metadata.creationTimestamp",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.creationTimestamp?ee(e.metadata.creationTimestamp):"-"})},{title:"Actions",filtering:!1,render:e=>{var t,a;const r=`${e.metadata.namespace}/${(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"}`;var i;const s=null!==(i=null==J||null===(a=J.ownedApiProducts)||void 0===a?void 0:a.has(r))&&void 0!==i&&i;return U||D&&s?(0,n.jsxs)(g.A,{display:"flex",style:{gap:8},children:[(0,n.jsx)(x.A,{size:"small",startIcon:(0,n.jsx)(S.A,{}),onClick:()=>{_({open:!0,request:e,action:"approve",processing:!1})},color:"primary",variant:"outlined",children:"Approve"}),(0,n.jsx)(x.A,{size:"small",startIcon:(0,n.jsx)(P.A,{}),onClick:()=>{_({open:!0,request:e,action:"reject",processing:!1})},color:"secondary",variant:"outlined",children:"Reject"})]}):null}}],ae=[{title:"Name",field:"metadata.name",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.name})},{title:"User",field:"spec.requestedBy.userId",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.spec.requestedBy.userId})},{title:"API",field:"spec.apiProductRef.name",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(0,n.jsx)("strong",{children:(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"})})}},{title:"Namespace",field:"metadata.namespace",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.namespace})},{title:"Tier",field:"spec.planTier",render:e=>(0,n.jsx)(j.A,{label:e.spec.planTier,size:"small"})},{title:"Requested",field:"metadata.creationTimestamp",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.creationTimestamp?ee(e.metadata.creationTimestamp):"-"})},{title:"Approved",field:"status.reviewedAt",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(null===(t=e.status)||void 0===t?void 0:t.reviewedAt)?ee(e.status.reviewedAt):"-"})}},{title:"Reviewed By",field:"status.reviewedBy",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(null===(t=e.status)||void 0===t?void 0:t.reviewedBy)||"-"})}},{title:"Approval Type",field:"status.reviewedBy",render:e=>{var t;const a="system"===(null===(t=e.status)||void 0===t?void 0:t.reviewedBy);return(0,n.jsx)(j.A,{label:a?"Automatic":"Manual",size:"small",color:a?"default":"primary"})}}],ne=[{title:"Name",field:"metadata.name",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.name})},{title:"User",field:"spec.requestedBy.userId",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.spec.requestedBy.userId})},{title:"API",field:"spec.apiProductRef.name",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(0,n.jsx)("strong",{children:(null===(t=e.spec.apiProductRef)||void 0===t?void 0:t.name)||"unknown"})})}},{title:"Namespace",field:"metadata.namespace",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.namespace})},{title:"Tier",field:"spec.planTier",render:e=>(0,n.jsx)(j.A,{label:e.spec.planTier,size:"small"})},{title:"Requested",field:"metadata.creationTimestamp",render:e=>(0,n.jsx)(y.A,{variant:"body2",children:e.metadata.creationTimestamp?ee(e.metadata.creationTimestamp):"-"})},{title:"Rejected",field:"status.reviewedAt",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(null===(t=e.status)||void 0===t?void 0:t.reviewedAt)?ee(e.status.reviewedAt):"-"})}},{title:"Reviewed By",field:"status.reviewedBy",render:e=>{var t;return(0,n.jsx)(y.A,{variant:"body2",children:(null===(t=e.status)||void 0===t?void 0:t.reviewedBy)||"-"})}}],re=(()=>{const e=e=>e.map(e=>({...e,id:e.metadata.name}));switch(f){case 0:return{data:X.map(e=>{const t=N.some(t=>t.metadata.name===e.metadata.name&&t.metadata.namespace===e.metadata.namespace);return{...e,tableData:{checked:t}}}),columns:te,showSelection:!0};case 1:return{data:e(Y),columns:ae,showSelection:!1};case 2:return{data:e(Z),columns:ne,showSelection:!1};default:return{data:e(X),columns:te,showSelection:!0}}})(),ie=(e=>{const t=new Map;return e.forEach(e=>{var a;const n=`${e.metadata.namespace}/${(null===(a=e.spec.apiProductRef)||void 0===a?void 0:a.name)||"unknown"}`;t.has(n)||t.set(n,[]),t.get(n).push(e)}),t})(re.data),se=Array.from(ie.keys()).sort();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.n,{title:"API Access Requests",subheader:`${X.length} pending, ${Y.length} approved, ${Z.length} rejected`,children:[(0,n.jsx)(g.A,{mb:2,"data-testid":"approval-queue-card",children:(0,n.jsxs)(k.A,{value:f,onChange:(e,t)=>{B(t),L([])},indicatorColor:"primary",textColor:"primary","data-testid":"approval-queue-tabs",children:[(0,n.jsx)(w.A,{label:`Pending (${X.length})`,"data-testid":"approval-queue-pending-tab"}),(0,n.jsx)(w.A,{label:`Approved (${Y.length})`,"data-testid":"approval-queue-approved-tab"}),(0,n.jsx)(w.A,{label:`Rejected (${Z.length})`,"data-testid":"approval-queue-rejected-tab"})]})}),0===f&&N.length>0&&(0,n.jsxs)(g.A,{mb:2,display:"flex",alignItems:"center",justifyContent:"space-between",p:2,bgcolor:"background.default",children:[(0,n.jsxs)(y.A,{variant:"body2",children:[N.length," request",1!==N.length?"s":""," selected"]}),(0,n.jsxs)(g.A,{display:"flex",style:{gap:8},children:[(0,n.jsx)(x.A,{size:"small",variant:"contained",color:"primary",startIcon:(0,n.jsx)(S.A,{}),onClick:()=>{0!==N.length&&W({open:!0,requests:N,action:"approve",processing:!1})},children:"Approve Selected"}),(0,n.jsx)(x.A,{size:"small",variant:"contained",color:"secondary",startIcon:(0,n.jsx)(P.A,{}),onClick:()=>{0!==N.length&&W({open:!0,requests:N,action:"reject",processing:!1})},children:"Reject Selected"})]})]}),0===re.data.length?(0,n.jsx)(g.A,{p:3,textAlign:"center",children:(0,n.jsxs)(y.A,{variant:"body1",color:"textSecondary",children:[0===f&&"No pending requests.",1===f&&"No approved requests.",2===f&&"No rejected requests."]})}):(0,n.jsx)(g.A,{children:se.map(e=>{var t,a,r;const i=ie.get(e)||[],s=(null===(a=i[0])||void 0===a||null===(t=a.spec.apiProductRef)||void 0===t?void 0:t.name)||e;var o;const d=null!==(o=null==J||null===(r=J.ownedApiProducts)||void 0===r?void 0:r.has(e))&&void 0!==o&&o,l=U||D&&d;return(0,n.jsxs)(C.A,{defaultExpanded:1===se.length,children:[(0,n.jsx)(q.A,{expandIcon:(0,n.jsx)(I.A,{}),children:(0,n.jsxs)(g.A,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",children:[(0,n.jsx)(y.A,{variant:"h6",children:s}),(0,n.jsx)(j.A,{label:`${i.length} request${1!==i.length?"s":""}`,size:"small",color:"primary",style:{marginRight:16}})]})}),(0,n.jsx)(R.A,{children:(0,n.jsx)(g.A,{width:"100%",children:(0,n.jsx)(c.X,{options:{selection:l&&re.showSelection,paging:i.length>5,pageSize:20,search:!0,filtering:!0,debounceInterval:300,showTextRowsSelected:!1,toolbar:!0,emptyRowsWhenPaging:!1},data:i,columns:re.columns,onSelectionChange:t=>{const a=N.filter(t=>{var a;return`${t.metadata.namespace}/${(null===(a=t.spec.apiProductRef)||void 0===a?void 0:a.name)||"unknown"}`!==e});L([...a,...t])}})})})]},e)})})]}),(0,n.jsx)(T,{open:z.open,request:z.request,action:z.action,processing:z.processing,onClose:()=>_({open:!1,request:null,action:"approve",processing:!1}),onConfirm:async()=>{if(!z.request||!J)return;_(e=>({...e,processing:!0}));const e="approve"===z.action?`${m}/api/kuadrant/requests/${z.request.metadata.namespace}/${z.request.metadata.name}/approve`:`${m}/api/kuadrant/requests/${z.request.metadata.namespace}/${z.request.metadata.name}/reject`;try{if(!(await t.fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviewedBy:J.reviewedBy})})).ok)throw new Error(`failed to ${z.action} request`);_({open:!1,request:null,action:"approve",processing:!1}),A(e=>e+1);const a="approve"===z.action?"approved":"rejected";h.post({message:`API key ${a}`,severity:"success",display:"transient"})}catch(e){console.error(`error ${z.action}ing request:`,e),_(e=>({...e,processing:!1})),h.post({message:`Failed to ${z.action} API key`,severity:"error",display:"transient"})}}}),(0,n.jsx)($,{open:E.open,requests:E.requests,action:E.action,processing:E.processing,onClose:()=>W({open:!1,requests:[],action:"approve",processing:!1}),onConfirm:async()=>{if(!J||0===E.requests.length)return;W(e=>({...e,processing:!0}));const e="approve"===E.action,a=e?`${m}/api/kuadrant/requests/bulk-approve`:`${m}/api/kuadrant/requests/bulk-reject`;try{if(!(await t.fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requests:E.requests.map(e=>({namespace:e.metadata.namespace,name:e.metadata.name})),reviewedBy:J.reviewedBy})})).ok)throw new Error(`failed to bulk ${E.action} requests`);const n=E.requests.length,r=e?"approved":"rejected";W({open:!1,requests:[],action:"approve",processing:!1}),L([]),A(e=>e+1),h.post({message:`${n} API keys ${r}`,severity:"success",display:"transient"})}catch(e){console.error(`error bulk ${E.action}ing requests:`,e),W(e=>({...e,processing:!1})),h.post({message:`Failed to bulk ${E.action} API keys`,severity:"error",display:"transient"})}}})]})}},46205:(e,t,a)=>{a.d(t,{W:()=>i,l:()=>r});var n=a(87421);function r(e,t){const a="resourceType"in e?{permission:e,resourceRef:t}:{permission:e},r=(0,n.J)(a);return{allowed:r.allowed,loading:r.loading,error:r.error}}function i(e,t,a,n){return!!n||!(!a||e!==t)}},52235:(e,t,a)=>{var n=a(4293),r=a(78920);t.A=void 0;var i=r(a(95478)),s=(0,n(a(74044)).default)(i.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward");t.A=s},55429:(e,t,a)=>{var n=a(4293),r=a(78920);t.A=void 0;var i=r(a(95478)),s=(0,n(a(74044)).default)(i.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");t.A=s},96040:(e,t,a)=>{a.d(t,{n:()=>I});var n=a(31085),r=a(40703),i=a(59469),s=a(48653),o=a(45685),d=a(37197),l=a(37976),c=a(53373),p=a.n(c),u=a(10394),h=a(72501),m=a(52235),v=a(37725);const g=(0,l.makeStyles)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function y(e){const{link:t,title:a,onClick:r}=e,i=g();return(0,n.jsxs)(u.A,{children:[(0,n.jsx)(d.A,{}),(0,n.jsx)(v.N_,{to:t,onClick:r,underline:"none",children:(0,n.jsxs)(u.A,{display:"flex",alignItems:"center",className:i.root,children:[(0,n.jsx)(u.A,{className:i.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(h.A,{children:(0,n.jsx)("strong",{children:a})})}),(0,n.jsx)(m.A,{className:i.arrow})]})})]})}var A=a(95478),x=a(64947);const f=(0,A.forwardRef)((e,t)=>(0,n.jsx)(v.N_,{ref:t,...e,color:"initial"})),j=(0,A.forwardRef)((e,t)=>(0,n.jsx)(x.A,{ref:t,component:f,...e}));var b=a(34169),k=a(21006),w=a(67550);const C=e=>{const{slackChannel:t}=e,{t:a}=(0,w.i)(k.O);return t?"string"==typeof t?(0,n.jsx)(h.A,{children:a("errorBoundary.title",{slackChannel:t})}):t.href?(0,n.jsx)(j,{to:t.href,variant:"contained",children:t.name}):(0,n.jsx)(h.A,{children:a("errorBoundary.title",{slackChannel:t.name})}):null},q=class extends A.Component{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(e,t){console.error(`ErrorBoundary, error: ${e}`,{error:e,errorInfo:t}),this.setState({error:e,errorInfo:t})}render(){const{slackChannel:e,children:t}=this.props,{error:a}=this.state;return a?(0,n.jsx)(b.b,{title:"Something Went Wrong",error:a,children:(0,n.jsx)(C,{slackChannel:e})}):t}},R=(0,l.makeStyles)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),S=(0,l.withStyles)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(i.A),P={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function I(e){const{title:t,subheader:a,divider:l=!0,deepLink:c,slackChannel:u,errorBoundaryProps:h,variant:m,alignContent:v="normal",children:g,headerStyle:A,headerProps:x,icon:f,action:j,actionsClassName:b,actions:k,cardClassName:w,actionsTopRight:C,className:I,noPadding:T,titleTypographyProps:$,subheaderTypographyProps:B}=e,N=R();let L={},z={};m&&m.split(/[\s]+/g).forEach(e=>{L={...L,...P.card[e]},z={...z,...P.cardContent[e]}});const _=h||(u?{slackChannel:u}:{});return(0,n.jsx)(r.A,{style:L,className:I,children:(0,n.jsxs)(q,{..._,children:[t&&(0,n.jsx)(o.A,{classes:{root:p()(N.header),title:N.headerTitle,subheader:N.headerSubheader,avatar:N.headerAvatar,action:N.headerAction,content:N.headerContent},title:t,subheader:a||f?(0,n.jsxs)("div",{"data-testid":"info-card-subheader",children:[a&&(0,n.jsx)("div",{className:N.subheader,children:a}),f]}):null,action:j,style:{...A},titleTypographyProps:$,subheaderTypographyProps:B,...x}),C&&(0,n.jsx)(S,{children:C}),l&&(0,n.jsx)(d.A,{}),(0,n.jsx)(s.A,{className:p()(w,{[N.noPadding]:T,[N.contentAlignBottom]:"bottom"===v}),style:z,children:g}),k&&(0,n.jsx)(i.A,{className:b,children:k}),c&&(0,n.jsx)(y,{...c})]})})}}}]);
|
|
2
|
+
//# sourceMappingURL=3097.582b68d3.chunk.js.map
|