diff --git a/src/main/resources/webview/main/index.js b/src/main/resources/webview/main/index.js index 7e6372ad2..da0097482 100644 --- a/src/main/resources/webview/main/index.js +++ b/src/main/resources/webview/main/index.js @@ -237,7 +237,7 @@ color: ${({theme:e})=>e.colors.v3.text.primary}; `,t.EntryCount=o.default.span` margin-left: auto; -`},81576:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetTypeList=t.ASSET_TYPE_IDS=void 0;const a=n(85893),s=n(67294),l=n(27921),c=n(921),u=n(63677),d=n(33787),p=n(55358),m=n(66721),f=n(55114),g=n(81440),h=n(72553),b=n(28992),_=n(38864),y=n(90108),v=n(90481),E=n(17108),S=n(65499),T=n(37001),C=i(n(99144));t.ASSET_TYPE_IDS=["Endpoint","Consumer","DatabaseQueries","CodeLocation","EndpointClient","Cache","Other"],t.AssetTypeList=({filters:e,searchQuery:n,scopeViewOptions:r,setRefresher:o,onAssetCountChange:i,onAssetTypeSelect:O})=>{const[x,w]=(0,s.useState)(),I=(0,c.usePrevious)(x),[R,A]=(0,s.useState)(),N=(0,c.usePrevious)(R),{scope:k,environment:D}=(0,u.useConfigSelector)(),P=(0,c.usePrevious)(D),j=(0,s.useRef)(),M=(0,c.usePrevious)(n),L=(0,c.usePrevious)(r),F=!k?.span?.spanCodeObjectId,{setShowAssetsHeaderToolBox:B}=d.useStore.getState(),[U,G]=(0,s.useState)(!1),$=!x,H=(0,s.useCallback)((()=>((e={services:[],operations:[],insights:[]},t,n,r)=>{window.sendMessageToDigma({action:v.actions.GET_CATEGORIES_DATA,payload:{query:{directOnly:n,scopedSpanCodeObjectId:r,...r?{...e,services:[]}:e,...t.length>0?{displayName:t}:{}}}})})(e,n,r?.isDirect,r?.scopedSpanCodeObjectId)),[e,r?.isDirect,r?.scopedSpanCodeObjectId,n]);(0,s.useEffect)((()=>{o(H)}),[H,o]);const z=(0,S.checkIfAnyFiltersApplied)(e,n,F);(0,s.useEffect)((()=>{H()}),[H]),(0,s.useEffect)((()=>{const e=(e,t,n)=>{n||w(e),A(t)};return l.dispatcher.addActionListener(v.actions.SET_CATEGORIES_DATA,e),()=>{l.dispatcher.removeActionListener(v.actions.SET_CATEGORIES_DATA,e),window.clearTimeout(j.current)}}),[]),(0,s.useEffect)((()=>{if(x&&I!==x){i(x.assetCategories.reduce(((e,t)=>e+t.count),0));const e=x&&x.parents.length>0&&x?.assetCategories.every((e=>0===e.count));B(!e),G(e)}}),[I,x,i,B]),(0,s.useEffect)((()=>{((0,p.isEnvironment)(P)&&P.id!==D?.id||(0,f.isString)(M)&&M!==n||L!==r)&&H()}),[D?.id,P,M,L,r,n,H]),(0,s.useEffect)((()=>{N!==R&&(window.clearTimeout(j.current),j.current=window.setTimeout((()=>{H()}),1e4))}),[R,N,H]);const V=e=>{O(e)};if($)return(0,a.jsx)(y.NoDataMessage,{type:"loading"});if(x?.assetCategories.every((e=>0===e.count)))return z?(0,a.jsx)(y.NoDataMessage,{type:"noSearchResults"}):k?U?(0,a.jsx)(C.EmptyStateContainer,{children:(0,a.jsx)(C.StyledEmptyState,{icon:_.ChildIcon,title:"No Child Assets",content:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(C.EmptyStateTextContainer,{children:[(0,a.jsx)("span",{children:"There are no child assets under this asset. You can try"}),(0,a.jsx)("span",{children:"browsing its parent spans to continue to explore the trace."})]}),x.parents.map((e=>(0,a.jsx)(C.ParentLink,{onClick:()=>{return t=e.spanCodeObjectId,(0,h.sendUserActionTrackingEvent)(E.trackingEvents.ALL_ASSETS_LINK_CLICKED),void(0,g.changeScope)({span:{spanCodeObjectId:t},context:{event:b.SCOPE_CHANGE_EVENTS.ASSETS_EMPTY_CATEGORY_PARENT_LINK_CLICKED}});var t},children:e.displayName},e.spanCodeObjectId)))]})})}):(0,a.jsx)(y.NoDataMessage,{type:"noDataForAsset"}):(0,a.jsx)(y.NoDataMessage,{type:"noDataYet"});const Y=t.ASSET_TYPE_IDS.map((e=>{const t=x?.assetCategories.find((t=>t.name===e)),n=(0,S.getAssetTypeInfo)(e);return t&&n?{...t,...n}:null})).filter((e=>!(0,m.isNull)(e)&&e.count>0));return(0,a.jsx)(C.List,{children:Y.map((e=>(0,a.jsx)(T.AssetTypeListItem,{id:e.name,icon:e?.icon,entryCount:e.count,label:e.label,onAssetTypeClick:V},e.name)))})}},99144:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ParentLink=t.StyledEmptyState=t.EmptyStateTextContainer=t.EmptyStateContainer=t.List=void 0;const o=r(n(70394)),i=n(42414),a=n(19317),s=n(4855);t.List=o.default.ul` +`},81576:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetTypeList=t.ASSET_TYPE_IDS=void 0;const a=n(85893),s=n(67294),l=n(27921),c=n(921),u=n(63677),d=n(33787),p=n(55358),m=n(66721),f=n(55114),g=n(81440),h=n(72553),b=n(28992),_=n(38864),y=n(90108),v=n(90481),E=n(17108),S=n(65499),T=n(37001),C=i(n(99144));t.ASSET_TYPE_IDS=["Endpoint","Consumer","DatabaseQueries","CodeLocation","EndpointClient","Cache","Other"],t.AssetTypeList=({filters:e,searchQuery:n,scopeViewOptions:r,setRefresher:o,onAssetCountChange:i,onAssetTypeSelect:O})=>{const[x,w]=(0,s.useState)(),I=(0,c.usePrevious)(x),[R,A]=(0,s.useState)(),N=(0,c.usePrevious)(R),{scope:k,environment:D}=(0,u.useConfigSelector)(),P=(0,c.usePrevious)(D),j=(0,s.useRef)(),M=(0,c.usePrevious)(n),L=(0,c.usePrevious)(r),F=!k?.span?.spanCodeObjectId,{setShowAssetsHeaderToolBox:B}=d.useStore.getState(),[U,G]=(0,s.useState)(!1),$=!x,H=(0,s.useCallback)((()=>((e={services:[],operations:[],insights:[]},t,n,r)=>{window.sendMessageToDigma({action:v.actions.GET_CATEGORIES_DATA,payload:{query:{directOnly:n,scopedSpanCodeObjectId:r,...r?{...e,services:[]}:e,...t.length>0?{displayName:t}:{}}}})})(e,n,r?.isDirect,r?.scopedSpanCodeObjectId)),[e,r?.isDirect,r?.scopedSpanCodeObjectId,n]);(0,s.useEffect)((()=>{o(H)}),[H,o]);const z=(0,S.checkIfAnyFiltersApplied)(e,n,F);(0,s.useEffect)((()=>{H()}),[H]),(0,s.useEffect)((()=>{const e=(e,t,n)=>{n||w(e),A(t)};return l.dispatcher.addActionListener(v.actions.SET_CATEGORIES_DATA,e),()=>{l.dispatcher.removeActionListener(v.actions.SET_CATEGORIES_DATA,e),window.clearTimeout(j.current)}}),[]),(0,s.useEffect)((()=>{if(x&&I!==x){i(x.assetCategories.reduce(((e,t)=>e+t.count),0));const e=Boolean(x?.parents&&x.parents.length>0&&x?.assetCategories.every((e=>0===e.count)));B(!e),G(e)}}),[I,x,i,B]),(0,s.useEffect)((()=>{((0,p.isEnvironment)(P)&&P.id!==D?.id||(0,f.isString)(M)&&M!==n||L!==r)&&H()}),[D?.id,P,M,L,r,n,H]),(0,s.useEffect)((()=>{N!==R&&(window.clearTimeout(j.current),j.current=window.setTimeout((()=>{H()}),1e4))}),[R,N,H]);const V=e=>{O(e)};if($)return(0,a.jsx)(y.NoDataMessage,{type:"loading"});if(x?.assetCategories.every((e=>0===e.count)))return z?(0,a.jsx)(y.NoDataMessage,{type:"noSearchResults"}):k?U&&x.parents?(0,a.jsx)(C.EmptyStateContainer,{children:(0,a.jsx)(C.StyledEmptyState,{icon:_.ChildIcon,title:"No Child Assets",content:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(C.EmptyStateTextContainer,{children:[(0,a.jsx)("span",{children:"There are no child assets under this asset. You can try"}),(0,a.jsx)("span",{children:"browsing its parent spans to continue to explore the trace."})]}),x.parents.map((e=>(0,a.jsx)(C.ParentLink,{onClick:()=>{return t=e.spanCodeObjectId,(0,h.sendUserActionTrackingEvent)(E.trackingEvents.ALL_ASSETS_LINK_CLICKED),void(0,g.changeScope)({span:{spanCodeObjectId:t},context:{event:b.SCOPE_CHANGE_EVENTS.ASSETS_EMPTY_CATEGORY_PARENT_LINK_CLICKED}});var t},children:e.displayName},e.spanCodeObjectId)))]})})}):(0,a.jsx)(y.NoDataMessage,{type:"noDataForAsset"}):(0,a.jsx)(y.NoDataMessage,{type:"noDataYet"});const Y=t.ASSET_TYPE_IDS.map((e=>{const t=x?.assetCategories.find((t=>t.name===e)),n=(0,S.getAssetTypeInfo)(e);return t&&n?{...t,...n}:null})).filter((e=>!(0,m.isNull)(e)&&e.count>0));return(0,a.jsx)(C.List,{children:Y.map((e=>(0,a.jsx)(T.AssetTypeListItem,{id:e.name,icon:e?.icon,entryCount:e.count,label:e.label,onAssetTypeClick:V},e.name)))})}},99144:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ParentLink=t.StyledEmptyState=t.EmptyStateTextContainer=t.EmptyStateContainer=t.List=void 0;const o=r(n(70394)),i=n(42414),a=n(19317),s=n(4855);t.List=o.default.ul` display: flex; flex-direction: column; gap: 8px;