@odigos/ui-kit 0.0.191 → 0.0.192

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.192](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.191...ui-kit-v0.0.192) (2026-02-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **source-drawer:** "Rendered more hooks than during the previous render" ([#665](https://github.com/odigos-io/ui-kit/issues/665)) ([49e803b](https://github.com/odigos-io/ui-kit/commit/49e803bb5d5932c8be892e896bc76212091eeaf3))
9
+
3
10
  ## [0.0.191](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.190...ui-kit-v0.0.191) (2026-02-11)
4
11
 
5
12
 
package/lib/containers.js CHANGED
@@ -479,7 +479,7 @@ import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{useState
479
479
  display: flex;
480
480
  flex-direction: column;
481
481
  gap: 12px;
482
- `;var Vr;!function(e){e.Workload="Workload",e.Pod="Pod"}(Vr||(Vr={}));const Br=({persistSources:o,updateSource:l,restartWorkloads:c,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,restartPod:h})=>{const{isVm:m}=Le(),{sources:y}=W(),{selectedStreamName:v}=Je(),{drawerType:b,drawerEntityId:f}=K(),x=s(()=>Ge(y,v),[y,v]),S=r(null),$=b===B.Source,[C,w]=n(!1),[k,D]=n(!1),[T,N]=n(Pr.Overview),[E,A]=n(null);a(()=>{$&&f&&d(f).then(e=>A(e||null))},[$,f]);const{formData:F,handleFormChange:O,resetFormData:I,loadFormWithDrawerItem:R}=ui(),M=s(()=>{if(f)return E&&JSON.stringify(Ut(E))===JSON.stringify(Ut(f))?E:x?.find(e=>JSON.stringify(Ut(e))===JSON.stringify(Ut(f)))},[f,x,E]);a(()=>{$&&M?R(M):I()},[$,M]);const L=s(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ue.Loading,containers:M?.containers||[]}},[M]),j=s(()=>{const e=[{label:Pr.Overview,onClick:()=>N(Pr.Overview),selected:T===Pr.Overview}];return m||(Kr.includes(M?.kind)&&e.push({label:Pr.Pods,onClick:()=>N(Pr.Pods),selected:T===Pr.Pods}),M?.containers?.some(({language:e})=>qr.includes(e))&&e.push({label:Pr.Libraries,onClick:()=>N(Pr.Libraries),selected:T===Pr.Libraries})),e},[T,M,m]);if(!M)return null;const q=jr.includes(M?.kind),[H,z]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return e(En,{ref:S,onClose:()=>{N(Pr.Overview),A(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:ze(M.containers),isEdit:C,isFormDirty:k,onEdit:T===Pr.Overview?e=>{w("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=F.otelServiceName!==M.name?F.otelServiceName:"";O("otelServiceName",e),await l(f,{...F,otelServiceName:e}),A(null),D(!1),w(!1)},onDelete:T===Pr.Overview?async()=>{const{namespace:e}=M;o({[e]:[{...M,selected:!1,currentStreamName:v}]},{}),A(null),D(!1),w(!1),S.current?.closeDrawer()}:void 0,onCancel:()=>{D(!1),w(!1),O("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===x.length,tabs:j,headerActionButtons:m?[]:q?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>z({openFor:Vr.Workload,workloadId:f}),children:e(i,{children:[t(Hi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[T===Pr.Overview?C?t(Hr,{children:t(Or,{formData:F,handleFormChange:(...e)=>{D(!0),O(...e),O("currentStreamName",v)}})}):e(zr,{children:[t(Ir,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),t(G,{conditions:M.conditions||[]}),t(Y,{title:g.SOURCE_DETAILS,data:M?Ar(M,m):[]}),t(Y,{title:m?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:L.isLoading?ue.Loading:L.containers.length,description:L.description||(m?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:L.containers.map(e=>t(mi,{...e,callbackRuntimeOverride:e=>l(f,e)},`source-container-${e.containerName}`))}),M.manifestYAML&&t(rn,{title:`${M.kind} YAML`,yaml:M.manifestYAML,defaultOpen:!M.instrumentationConfigYAML}),M.instrumentationConfigYAML&&t(rn,{title:"Instrumentation Config YAML",yaml:M.instrumentationConfigYAML,defaultOpen:!M.manifestYAML})]}):T===Pr.Pods?t(Rr,{source:M,fetchSourceDescribe:u,onClickRestartPod:q?(e,t)=>z({openFor:Vr.Pod,podNamespace:e,podName:t}):void 0}):t(Lr,{source:M,fetchSourceLibraries:p}),t(_t,{isOpen:!!H.openFor,title:`Rollout Restart ${H.openFor}`,description:`Are you sure you want to rollout restart this ${H.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{H.openFor===Vr.Workload&&H.workloadId?c([H.workloadId]):H.openFor===Vr.Pod&&H.podNamespace&&H.podName&&h(H.podNamespace,H.podName),z({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{z({openFor:null})}}})]})},Wr=p.div`
482
+ `;var Vr;!function(e){e.Workload="Workload",e.Pod="Pod"}(Vr||(Vr={}));const Br=({persistSources:o,updateSource:l,restartWorkloads:c,fetchSourceById:d,fetchSourceDescribe:u,fetchSourceLibraries:p,restartPod:h})=>{const{isVm:m}=Le(),{sources:y}=W(),{selectedStreamName:v}=Je(),{drawerType:b,drawerEntityId:f}=K(),x=s(()=>Ge(y,v),[y,v]),S=r(null),$=b===B.Source,[C,w]=n(!1),[k,D]=n(!1),[T,N]=n(Pr.Overview),[E,A]=n(null);a(()=>{$&&f&&d(f).then(e=>A(e||null))},[$,f]);const{formData:F,handleFormChange:O,resetFormData:I,loadFormWithDrawerItem:R}=ui(),M=s(()=>{if(f)return E&&JSON.stringify(Ut(E))===JSON.stringify(Ut(f))?E:x?.find(e=>JSON.stringify(Ut(e))===JSON.stringify(Ut(f)))},[f,x,E]);a(()=>{$&&M?R(M):I()},[$,M]);const L=s(()=>{const e=M?.conditions?.find(({type:e})=>"RuntimeDetection"===e);return{description:e?.message,isLoading:e?.status===ue.Loading,containers:M?.containers||[]}},[M]),j=s(()=>{const e=[{label:Pr.Overview,onClick:()=>N(Pr.Overview),selected:T===Pr.Overview}];return m||(Kr.includes(M?.kind)&&e.push({label:Pr.Pods,onClick:()=>N(Pr.Pods),selected:T===Pr.Pods}),M?.containers?.some(({language:e})=>qr.includes(e))&&e.push({label:Pr.Libraries,onClick:()=>N(Pr.Libraries),selected:T===Pr.Libraries})),e},[T,M,m]),q=jr.includes(M?.kind),[H,z]=n({openFor:null,workloadId:void 0,podNamespace:void 0,podName:void 0});return M?e(En,{ref:S,onClose:()=>{N(Pr.Overview),A(null)},title:M.otelServiceName||M.name,titleTooltip:"This attribute is used to identify the name of the service (service.name) that is generating telemetry data.",hideEditTitleFromEdit:!0,icons:ze(M.containers),isEdit:C,isFormDirty:k,onEdit:T===Pr.Overview?e=>{w("boolean"!=typeof e||e)}:void 0,onSave:async()=>{const e=F.otelServiceName!==M.name?F.otelServiceName:"";O("otelServiceName",e),await l(f,{...F,otelServiceName:e}),A(null),D(!1),w(!1)},onDelete:T===Pr.Overview?async()=>{const{namespace:e}=M;o({[e]:[{...M,selected:!1,currentStreamName:v}]},{}),A(null),D(!1),w(!1),S.current?.closeDrawer()}:void 0,onCancel:()=>{D(!1),w(!1),O("otelServiceName",M.otelServiceName||M.name||"")},isLastItem:1===x.length,tabs:j,headerActionButtons:m?[]:q?[{"data-id":"rollout-restart",variant:"tertiary",onClick:()=>z({openFor:Vr.Workload,workloadId:f}),children:e(i,{children:[t(Hi,{}),t(P,{size:14,family:"secondary",decoration:"underline",children:"Restart"})]})}]:[],children:[T===Pr.Overview?C?t(Hr,{children:t(Or,{formData:F,handleFormChange:(...e)=>{D(!0),O(...e),O("currentStreamName",v)}})}):e(zr,{children:[t(Ir,{workloadOdigosHealthStatus:M.workloadOdigosHealthStatus}),t(G,{conditions:M.conditions||[]}),t(Y,{title:g.SOURCE_DETAILS,data:M?Ar(M,m):[]}),t(Y,{title:m?g.DETECTED_PROCESSES:g.DETECTED_CONTAINERS,titleBadge:L.isLoading?ue.Loading:L.containers.length,description:L.description||(m?g.DETECTED_PROCESSES_DESCRIPTION:g.DETECTED_CONTAINERS_DESCRIPTION),children:L.containers.map(e=>t(mi,{...e,callbackRuntimeOverride:e=>l(f,e)},`source-container-${e.containerName}`))}),M.manifestYAML&&t(rn,{title:`${M.kind} YAML`,yaml:M.manifestYAML,defaultOpen:!M.instrumentationConfigYAML}),M.instrumentationConfigYAML&&t(rn,{title:"Instrumentation Config YAML",yaml:M.instrumentationConfigYAML,defaultOpen:!M.manifestYAML})]}):T===Pr.Pods?t(Rr,{source:M,fetchSourceDescribe:u,onClickRestartPod:q?(e,t)=>z({openFor:Vr.Pod,podNamespace:e,podName:t}):void 0}):t(Lr,{source:M,fetchSourceLibraries:p}),t(_t,{isOpen:!!H.openFor,title:`Rollout Restart ${H.openFor}`,description:`Are you sure you want to rollout restart this ${H.openFor?.toLowerCase()}?`,approveButton:{text:"Confirm",variant:ne.Warning,onClick:()=>{H.openFor===Vr.Workload&&H.workloadId?c([H.workloadId]):H.openFor===Vr.Pod&&H.podNamespace&&H.podName&&h(H.podNamespace,H.podName),z({openFor:null})}},denyButton:{text:"Go Back",onClick:()=>{z({openFor:null})}}})]}):null},Wr=p.div`
483
483
  max-width: ${({$fullWidth:e})=>e?"unset":"420px"};
484
484
  width: 100%;
485
485
  `,_r=o(({isModal:i,fetchSingleNamespace:n,onClickSummary:a},o)=>{const r=m(),{isVm:s}=Le(),c=gi({fetchSingleNamespace:n}),{selectedSources:d,fetchingNamespace:u,selectedAllNamespaces:p,onSelectAllNamespaces:h,getApiSourcesPayload:y,getApiFutureAppsPayload:v,searchText:b,setSearchText:f,searchBy:x,setSearchBy:S,showSelectedOnly:$,setShowSelectedOnly:w,showRunningOnly:k,setShowRunningOnly:D}=c;l(o,()=>({getFormValues:()=>({apps:y(),futureApps:v()})}));const N=Object.values(d).reduce((e,t)=>e+t.filter(e=>e.selected).length,0);return t(te,{$isNotModal:!i,children:e(se,{$gap:12,children:[e(se,{$gap:24,children:[a&&t(vt,{onClick:a}),t(I,{title:g.SELECT_SOURCES,badgeLabel:N,description:g.SELECT_SOURCES_DESCRIPTION}),e(pe,{$justifyContent:"space-between",children:[t(Wr,{$fullWidth:s,children:t(C,{placeholder:x===B.Source?g.SEARCH_SOURCES:g.SEARCH_NAMESPACES,icon:Mi,value:b,onChange:e=>f(e.target.value.toLowerCase())})}),!s&&t(F,{options:[{label:g.SOURCE,value:B.Source,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary},{label:g.NAMESPACE,value:B.Namespace,selectedBgColor:r.text.secondary,selectedTextColor:r.text.primary}],selected:x,setSelected:S})]}),e(pe,{$gap:36,children:[t(T,{title:g.SELECT_ALL,initialValue:p,onChange:h,disabled:!!u}),t(T,{title:g.ONLY_SELECTED,initialValue:$,onChange:w}),t(T,{title:g.ONLY_RUNNING_INSTANCES,initialValue:k,onChange:D})]})]}),t(re,{}),t(Cr,{isModal:i,...c})]})})});_r.displayName=_r.name;const Jr=({fetchSingleNamespace:e,persistSources:i})=>{const{currentModal:n,setCurrentModal:a}=Q(),o=n===B.Source,l=()=>{a("")},s=async()=>{if(c.current){const{apps:e,futureApps:t}=c.current.getFormValues();i(e,t),l()}},c=r(null);return j({key:"Enter",active:o},s),o?t(ee,{isOpen:o,onClose:l,header:{title:"Add Source"},actionComponent:t(le,{buttons:[{label:"DONE",variant:"primary",onClick:s}]}),children:t(_r,{ref:c,isModal:!0,fetchSingleNamespace:e})}):null},Ur=e=>{const t=[{key:"checkbox-and-icon",title:""},{key:"name",title:g.NAME,sortable:!0},{key:"kind",title:"Kind",sortable:!0}];return e||t.push({key:"namespace",title:g.NAMESPACE,sortable:!0}),t.push({key:"containers",title:g.DETECTED_CONTAINERS}),t.push({key:"conditions",title:"Conditions"}),t.push({key:"throughput",title:"Throughput",sortable:!0}),t},Gr=({metrics:i,maxHeight:n,maxWidth:a})=>{const o=m(),{isVm:r}=Le(),l=ye(),{selectedStreamName:c}=Je(),{sources:u,sourcesLoading:p}=W(),{setDrawerType:h,setDrawerEntityId:y}=K(),{selectedSources:v,setSelectedSources:b}=Re(),{progress:f}=Be(),x=s(()=>f[We.Instrumenting]||f[We.Uninstrumenting]?f[We.Instrumenting]?.percentage||f[We.Uninstrumenting]?.percentage||0:void 0,[f[We.Instrumenting],f[We.Uninstrumenting]]),$=s(()=>Ge(u,c),[u,c]),C=s(()=>jn({instrumentationRules:[],sources:Xe($,l),actions:[],destinations:[],searchText:l.searchText,selectedCategory:B.Source}).searchResults.find(({category:e})=>e===B.Source)?.entities||[],[$,l]),[w,k]=s(()=>{let e=0;return Object.values(v).forEach(t=>{e+=t.length}),[0!==e,e]},[v]),D=d(e=>{if(e){const e={};C.forEach(t=>{const{namespace:i}=t;e[i]?e[i].push(t):e[i]=[t]}),b(e)}else b({})},[C]),T=d(e=>{const{namespace:t,name:i,kind:n}=e,a={...v};a[t]||(a[t]=[]);const o=a[t].findIndex(e=>e.name===i&&e.kind===n);-1===o?a[t].push(e):a[t].splice(o,1),b(a)},[v]),N=s(()=>C.map(n=>{const a=Ut(n),r=JSON.stringify(a),{hasErrors:l,hasWarnings:s,hasDisableds:c}=ce(n.conditions||[]),d=!!v[a.namespace]?.find(e=>e.namespace===a.namespace&&e.name===a.name&&e.kind===a.kind);return{status:l?ne.Error:s?ne.Warning:void 0,faded:c,onClick:()=>{h(B.Source),y(a)},cells:[{columnKey:"checkbox-and-icon",component:()=>e(pe,{$gap:16,children:[t(S,{value:d,onChange:()=>T(n)}),t(yi,{icons:ze(n.containers),id:r})]})},{columnKey:"name",value:fe(n,B.Source,{extended:!0})},{columnKey:"kind",value:n.kind,textColor:o.text.info},{columnKey:"namespace",value:n.namespace,textColor:o.text.info},{columnKey:"throughput",value:Ke(Ot(i,B.Source,a).throughput),textColor:o.text.info},{columnKey:"conditions",component:()=>t(Pn,{conditions:n.conditions||[],id:r})},{columnKey:"containers",component:()=>t("div",{style:{lineHeight:1},children:t(de,{status:ne.Info,title:vi(n.containers),withBorder:!0})})}]}}),[C,v,i,T]),{badge:E,badgeTooltip:A}=s(()=>C.length!==$.length?{badge:`${C.length}/${$.length}`,badgeTooltip:g.FILTERED_COUNT_TOOLTIP}:{badge:$.length,badgeTooltip:void 0},[C,$]);return e(Se,{$maxWidth:a,children:[e($e,{children:[t(S,{partiallyChecked:w&&C?.length!==k,value:w&&C?.length===k,onChange:D,disabled:!C?.length}),t(Ce,{icon:we(B.Source),title:g.SOURCES,badge:E,badgeTooltip:A,loading:p||"number"==typeof x})]}),t(ke,{$maxHeight:n,children:t(De,{columns:Ur(r),rows:N})}),"number"!=typeof x||N.length?N.length?null:t(Te,{style:{marginTop:"2rem"},children:t(Ne,{})}):e(Te,{style:{marginTop:"2rem",gap:"24px"},children:[t(Ee,{width:420}),e(pe,{$gap:16,children:[e(P,{color:o.text.info,children:[f[We.Instrumenting]?"Instrumenting":"Uninstrumenting"," workloads..."]}),t(Ae,{label:`${x}%`})]})]})]})},Yr=({expiresAt:t})=>{const i=m(),{formatTimeAgo:n}=Gt(),a=n(t),o=new Date(t).toDateString().split(" ").slice(1).join(" "),r=bi(t,0)?i.text.error:bi(t,6048e5)?i.text.warning:i.text.success;return e(P,{size:14,color:r,children:[a," (",o,")"]})},Xr=p.div`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.191",
3
+ "version": "0.0.192",
4
4
  "author": "Odigos",
5
5
  "license": "MIT",
6
6
  "repository": {