From 4d6c9b42e130a612bcf88d3695db4e2935a5d50b Mon Sep 17 00:00:00 2001 From: opoliarush Date: Wed, 25 Sep 2024 13:44:15 +0300 Subject: [PATCH] Update UI: - added new internal operations category --- src/main/resources/webview/main/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/webview/main/index.js b/src/main/resources/webview/main/index.js index 1c3f6bac9..e0410ac4f 100644 --- a/src/main/resources/webview/main/index.js +++ b/src/main/resources/webview/main/index.js @@ -238,7 +238,7 @@ color: ${({theme:e})=>e.colors.v3.text.primary}; `,t.EntryCount=o.default.span` margin-left: auto; -`},21280: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(74848),s=n(96540),l=n(25119),c=n(17233),u=n(79605),d=n(2569),p=n(36972),m=n(8102),f=n(44106),g=n(7410),h=n(51094),b=n(38492),_=n(64666),y=n(38585),v=n(48842),E=n(43756),S=n(42602),T=n(21534),C=n(26492),O=i(n(82036));t.ASSET_TYPE_IDS=["Endpoint","Consumer","DatabaseQueries","CodeLocation","EndpointClient","Cache","Other"],t.AssetTypeList=({setRefresher:e,onAssetCountChange:n,onAssetTypeSelect:r})=>{const{search:o,viewMode:i,filters:x,assetCategoriesData:w}=(0,u.useAssetsSelector)(),{setAssetCategoriesData:I,setShowAssetsHeaderToolBox:A}=p.useStore.getState(),R=(0,c.usePrevious)(o),N=(0,c.usePrevious)(i),k=(0,c.usePrevious)(w),[D,P]=(0,s.useState)(),j=(0,c.usePrevious)(D),{scope:M,environment:L}=(0,d.useConfigSelector)(),F=M?.span?.spanCodeObjectId,B=(0,c.usePrevious)(F),U=(0,c.usePrevious)(L),G=(0,s.useRef)(),$=!M?.span?.spanCodeObjectId,[H,z]=(0,s.useState)(!1),V=!w,Y=(0,s.useCallback)((()=>((e,t,n,r)=>{window.sendMessageToDigma({action:E.actions.GET_CATEGORIES_DATA,payload:{query:{directOnly:"children"===n,scopedSpanCodeObjectId:r,...r?{...e,services:[]}:e,...t.length>0?{displayName:t}:{}}}})})(x,o,i,F)),[x,F,i,o]);(0,s.useEffect)((()=>{e(Y)}),[Y,e]);const W=(0,T.checkIfAnyFiltersApplied)(x,o,$);(0,s.useEffect)((()=>{Y()}),[Y]),(0,s.useEffect)((()=>{const e=(e,t,n)=>{n||I(e),P(t)};return l.dispatcher.addActionListener(E.actions.SET_CATEGORIES_DATA,e),()=>{l.dispatcher.removeActionListener(E.actions.SET_CATEGORIES_DATA,e),window.clearTimeout(G.current)}}),[I]),(0,s.useEffect)((()=>{if(w&&k!==w){n(w.assetCategories.reduce(((e,t)=>e+t.count),0));const e=Boolean(w?.parents&&w.parents.length>0&&w?.assetCategories.every((e=>0===e.count)));A(!e),z(e)}}),[k,w,n,A]),(0,s.useEffect)((()=>{((0,m.isEnvironment)(U)&&U.id!==L?.id||(0,g.isString)(R)&&R!==o||N!==i||B!==F)&&Y()}),[L?.id,U,o,R,B,F,i,N,Y]),(0,s.useEffect)((()=>{j!==D&&(window.clearTimeout(G.current),G.current=window.setTimeout((()=>{Y()}),1e4))}),[D,j,Y]);const q=e=>{r(e)};if(V)return(0,a.jsx)(v.NoDataMessage,{type:"loading"});if(w?.assetCategories.every((e=>0===e.count)))return W?(0,a.jsx)(v.NoDataMessage,{type:"noSearchResults"}):M?H&&w.parents?(0,a.jsx)(O.EmptyStateContainer,{children:(0,a.jsx)(O.StyledEmptyState,{icon:y.ChildIcon,title:"No Child Assets",content:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(O.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."})]}),w.parents.map((e=>(0,a.jsx)(O.ParentLink,{onClick:()=>{return t=e.spanCodeObjectId,(0,b.sendUserActionTrackingEvent)(S.trackingEvents.ALL_ASSETS_LINK_CLICKED),void(0,h.changeScope)({span:{spanCodeObjectId:t},context:{event:_.SCOPE_CHANGE_EVENTS.ASSETS_EMPTY_CATEGORY_PARENT_LINK_CLICKED}});var t},children:e.displayName},e.spanCodeObjectId)))]})})}):(0,a.jsx)(v.NoDataMessage,{type:"noDataForAsset"}):(0,a.jsx)(v.NoDataMessage,{type:"noDataYet"});const K=t.ASSET_TYPE_IDS.map((e=>{const t=w?.assetCategories.find((t=>t.name===e)),n=(0,T.getAssetTypeInfo)(e);return t&&n?{...t,...n}:null})).filter((e=>!(0,f.isNull)(e)&&e.count>0));return(0,a.jsx)(O.List,{children:K.map((e=>(0,a.jsx)(C.AssetTypeListItem,{id:e.name,icon:e?.icon,entryCount:e.count,label:e.label,onAssetTypeClick:q},e.name)))})}},82036: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(59616)),i=n(49086),a=n(63932),s=n(76936);t.List=o.default.ul` +`},21280: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(74848),s=n(96540),l=n(25119),c=n(17233),u=n(79605),d=n(2569),p=n(36972),m=n(8102),f=n(44106),g=n(7410),h=n(51094),b=n(38492),_=n(64666),y=n(38585),v=n(48842),E=n(43756),S=n(42602),T=n(21534),C=n(26492),O=i(n(82036));t.ASSET_TYPE_IDS=["Endpoint","Consumer","InternalOperation","DatabaseQueries","CodeLocation","EndpointClient","Cache","Other"],t.AssetTypeList=({setRefresher:e,onAssetCountChange:n,onAssetTypeSelect:r})=>{const{search:o,viewMode:i,filters:x,assetCategoriesData:w}=(0,u.useAssetsSelector)(),{setAssetCategoriesData:I,setShowAssetsHeaderToolBox:A}=p.useStore.getState(),R=(0,c.usePrevious)(o),N=(0,c.usePrevious)(i),k=(0,c.usePrevious)(w),[D,P]=(0,s.useState)(),j=(0,c.usePrevious)(D),{scope:M,environment:L}=(0,d.useConfigSelector)(),F=M?.span?.spanCodeObjectId,B=(0,c.usePrevious)(F),U=(0,c.usePrevious)(L),G=(0,s.useRef)(),$=!M?.span?.spanCodeObjectId,[H,z]=(0,s.useState)(!1),V=!w,Y=(0,s.useCallback)((()=>((e,t,n,r)=>{window.sendMessageToDigma({action:E.actions.GET_CATEGORIES_DATA,payload:{query:{directOnly:"children"===n,scopedSpanCodeObjectId:r,...r?{...e,services:[]}:e,...t.length>0?{displayName:t}:{}}}})})(x,o,i,F)),[x,F,i,o]);(0,s.useEffect)((()=>{e(Y)}),[Y,e]);const W=(0,T.checkIfAnyFiltersApplied)(x,o,$);(0,s.useEffect)((()=>{Y()}),[Y]),(0,s.useEffect)((()=>{const e=(e,t,n)=>{n||I(e),P(t)};return l.dispatcher.addActionListener(E.actions.SET_CATEGORIES_DATA,e),()=>{l.dispatcher.removeActionListener(E.actions.SET_CATEGORIES_DATA,e),window.clearTimeout(G.current)}}),[I]),(0,s.useEffect)((()=>{if(w&&k!==w){n(w.assetCategories.reduce(((e,t)=>e+t.count),0));const e=Boolean(w?.parents&&w.parents.length>0&&w?.assetCategories.every((e=>0===e.count)));A(!e),z(e)}}),[k,w,n,A]),(0,s.useEffect)((()=>{((0,m.isEnvironment)(U)&&U.id!==L?.id||(0,g.isString)(R)&&R!==o||N!==i||B!==F)&&Y()}),[L?.id,U,o,R,B,F,i,N,Y]),(0,s.useEffect)((()=>{j!==D&&(window.clearTimeout(G.current),G.current=window.setTimeout((()=>{Y()}),1e4))}),[D,j,Y]);const q=e=>{r(e)};if(V)return(0,a.jsx)(v.NoDataMessage,{type:"loading"});if(w?.assetCategories.every((e=>0===e.count)))return W?(0,a.jsx)(v.NoDataMessage,{type:"noSearchResults"}):M?H&&w.parents?(0,a.jsx)(O.EmptyStateContainer,{children:(0,a.jsx)(O.StyledEmptyState,{icon:y.ChildIcon,title:"No Child Assets",content:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(O.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."})]}),w.parents.map((e=>(0,a.jsx)(O.ParentLink,{onClick:()=>{return t=e.spanCodeObjectId,(0,b.sendUserActionTrackingEvent)(S.trackingEvents.ALL_ASSETS_LINK_CLICKED),void(0,h.changeScope)({span:{spanCodeObjectId:t},context:{event:_.SCOPE_CHANGE_EVENTS.ASSETS_EMPTY_CATEGORY_PARENT_LINK_CLICKED}});var t},children:e.displayName},e.spanCodeObjectId)))]})})}):(0,a.jsx)(v.NoDataMessage,{type:"noDataForAsset"}):(0,a.jsx)(v.NoDataMessage,{type:"noDataYet"});const K=t.ASSET_TYPE_IDS.map((e=>{const t=w?.assetCategories.find((t=>t.name===e)),n=(0,T.getAssetTypeInfo)(e);return t&&n?{...t,...n}:null})).filter((e=>!(0,f.isNull)(e)&&e.count>0));return(0,a.jsx)(O.List,{children:K.map((e=>(0,a.jsx)(C.AssetTypeListItem,{id:e.name,icon:e?.icon,entryCount:e.count,label:e.label,onAssetTypeClick:q},e.name)))})}},82036: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(59616)),i=n(49086),a=n(63932),s=n(76936);t.List=o.default.ul` display: flex; flex-direction: column; gap: 8px; @@ -375,7 +375,7 @@ flex-direction: column; text-align: center; gap: 8px; -`},42602:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trackingEvents=void 0;const r=n(6817);t.trackingEvents=(0,r.addPrefix)("assets",{FILTER_APPLIED:"filter applied",REFRESH_BUTTON_CLICKED:"refresh button clicked",FILTERS_POPUP_CLOSE_BUTTON_CLICKED:"filter popup close button clicked",ALL_ASSETS_LINK_CLICKED:"all assets link clicked"}," ")},21534:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkIfAnyFiltersApplied=t.getAssetTypeInfo=void 0;const r=n(98547),o=n(24912),i=n(90748),a=n(76454),s=n(97218);t.getAssetTypeInfo=e=>({Endpoint:{label:"Endpoints",icon:i.EndpointIcon},EndpointClient:{label:"HTTP Clients",icon:a.HTTPClientIcon},Consumer:{label:"Consumers",icon:s.UserIcon},DatabaseQueries:{label:"Database queries",icon:o.DatabaseIcon},CodeLocation:{label:"Code locations",icon:r.CodeMarkerPinIcon},Cache:{label:"Cache",icon:o.DatabaseIcon},Other:{label:"Other"}}[e]),t.checkIfAnyFiltersApplied=(e,t,n)=>Boolean([...e.insights,...e.operations,...n?e.services:[]].length>0)||t.length>0},81917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.actions=void 0;const r=n(6817);t.actions=(0,r.addPrefix)("DASHBOARD",{INITIALIZE:"INITIALIZE",GET_DATA:"GET_DATA",SET_DATA:"SET_DATA",GET_ENVIRONMENT_INFO:"GET_ENVIRONMENT_INFO",SET_ENVIRONMENT_INFO:"SET_ENVIRONMENT_INFO",GET_SERVICES:"GET_SERVICES",SET_SERVICES:"SET_SERVICES",GET_REPORT_ISSUES_STATS:"GET_REPORT_ISSUES_STATS",SET_REPORT_ISSUES_STATS:"SET_REPORT_ISSUES_STATS",GET_REPORT_ASSETS_STATS:"GET_REPORT_ASSETS_STATS",SET_REPORT_ASSETS_STATS:"SET_REPORT_ASSETS_STATS",GET_METRICS_REPORT_DATA:"GET_METRICS_REPORT_DATA",SET_METRICS_REPORT_DATA:"SET_METRICS_REPORT_DATA"})},30051: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.TimestampKeyValue=void 0;const a=n(74848),s=n(84077),l=n(57493),c=i(n(6559));t.TimestampKeyValue=({label:e,timestamp:t})=>{const n=new Date(t).toString();return(0,a.jsx)(l.Tooltip,{title:n,children:(0,a.jsxs)(c.Container,{children:[(0,a.jsxs)(c.Label,{children:[e,":"]}),(0,a.jsx)(c.TimeDistance,{children:(0,s.formatTimeDistance)(t)})]})},e)}},6559: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.TimeDistance=t.Label=t.Container=void 0;const o=r(n(59616)),i=n(49086);t.Container=o.default.div` +`},42602:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trackingEvents=void 0;const r=n(6817);t.trackingEvents=(0,r.addPrefix)("assets",{FILTER_APPLIED:"filter applied",REFRESH_BUTTON_CLICKED:"refresh button clicked",FILTERS_POPUP_CLOSE_BUTTON_CLICKED:"filter popup close button clicked",ALL_ASSETS_LINK_CLICKED:"all assets link clicked"}," ")},21534:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkIfAnyFiltersApplied=t.getAssetTypeInfo=void 0;const r=n(98547),o=n(24912),i=n(90748),a=n(76454),s=n(97218);t.getAssetTypeInfo=e=>({Endpoint:{label:"Endpoints",icon:i.EndpointIcon},EndpointClient:{label:"HTTP Clients",icon:a.HTTPClientIcon},Consumer:{label:"Consumers",icon:s.UserIcon},InternalOperation:{label:"Internal Operations",icon:i.EndpointIcon},DatabaseQueries:{label:"Database queries",icon:o.DatabaseIcon},CodeLocation:{label:"Code locations",icon:r.CodeMarkerPinIcon},Cache:{label:"Cache",icon:o.DatabaseIcon},Other:{label:"Other"}}[e]),t.checkIfAnyFiltersApplied=(e,t,n)=>Boolean([...e.insights,...e.operations,...n?e.services:[]].length>0)||t.length>0},81917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.actions=void 0;const r=n(6817);t.actions=(0,r.addPrefix)("DASHBOARD",{INITIALIZE:"INITIALIZE",GET_DATA:"GET_DATA",SET_DATA:"SET_DATA",GET_ENVIRONMENT_INFO:"GET_ENVIRONMENT_INFO",SET_ENVIRONMENT_INFO:"SET_ENVIRONMENT_INFO",GET_SERVICES:"GET_SERVICES",SET_SERVICES:"SET_SERVICES",GET_REPORT_ISSUES_STATS:"GET_REPORT_ISSUES_STATS",SET_REPORT_ISSUES_STATS:"SET_REPORT_ISSUES_STATS",GET_REPORT_ASSETS_STATS:"GET_REPORT_ASSETS_STATS",SET_REPORT_ASSETS_STATS:"SET_REPORT_ASSETS_STATS",GET_METRICS_REPORT_DATA:"GET_METRICS_REPORT_DATA",SET_METRICS_REPORT_DATA:"SET_METRICS_REPORT_DATA"})},30051: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.TimestampKeyValue=void 0;const a=n(74848),s=n(84077),l=n(57493),c=i(n(6559));t.TimestampKeyValue=({label:e,timestamp:t})=>{const n=new Date(t).toString();return(0,a.jsx)(l.Tooltip,{title:n,children:(0,a.jsxs)(c.Container,{children:[(0,a.jsxs)(c.Label,{children:[e,":"]}),(0,a.jsx)(c.TimeDistance,{children:(0,s.formatTimeDistance)(t)})]})},e)}},6559: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.TimeDistance=t.Label=t.Container=void 0;const o=r(n(59616)),i=n(49086);t.Container=o.default.div` ${i.subscriptRegularTypography} display: flex;