@odigos/ui-kit 0.0.160 → 0.0.161
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.161](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.160...ui-kit-v0.0.161) (2025-12-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* close delete warning on approve ([#573](https://github.com/odigos-io/ui-kit/issues/573)) ([9a1490c](https://github.com/odigos-io/ui-kit/commit/9a1490cbf3b8f31488d7a87adf690d79c31449e6))
|
|
9
|
+
|
|
3
10
|
## [0.0.160](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.159...ui-kit-v0.0.160) (2025-12-22)
|
|
4
11
|
|
|
5
12
|
|
package/lib/containers/v2.js
CHANGED
|
@@ -46,7 +46,7 @@ import e,{useState as t,useMemo as a,useEffect as l,useCallback as o}from"react"
|
|
|
46
46
|
justify-content: flex-end;
|
|
47
47
|
gap: 16px;
|
|
48
48
|
padding: 0 24px;
|
|
49
|
-
`,ke=({onClose:o,connections:n,selectedConnectionIds:s,setSelectedConnectionIds:r,getConnectionRemoteConfig:L,onApply:I})=>{const P=i(),[A,D]=t(""),S=a(()=>n.filter(e=>!A||e.name.toLowerCase().includes(A.toLowerCase())),[n,A]),V=s.length>0,T=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[M,z]=t(!1),[O,N]=t(!1),[j,F]=t(void 0),[U,E]=t(!1),[W,q]=t(void 0),{formData:H,handleFormChange:Y,areFormValuesEqual:K,resetFormData:J}=d({automaticRollout:!0}),Q=a(()=>s.length>1||void 0!==W&&!K(W,H),[s.length,W,H]);return l(()=>{1===s.length?(async e=>{if(U)return;E(!0);const t=await L(e);if(t){const e={automaticRollout:!t.rollout?.automaticRolloutDisabled};q(e),J(e)}E(!1)})(s[0]):q(void 0)},[s.length]),e.createElement(c,{isOpen:!0,hideOverlay:!0,width:be,header:{icon:G,title:"Cluster Configuration",onClose:o}},e.createElement(me,null,e.createElement(ye,null,e.createElement(u,{width:"40%",value:A,onChange:D}),Q?e.createElement(p,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):1===s.length&&void 0!==W?e.createElement(p,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}):null),e.createElement(he,null,e.createElement(fe,{$width:"40%"},e.createElement(b,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(b,{$gap:8},e.createElement(m,{size:y.XS},"Clusters"),e.createElement(h,{label:n.length,status:f.Unknown})),e.createElement(b,{$gap:8},e.createElement(m,{size:y.XXXS,color:P.v2.colors.silver[200]},"Selected"),e.createElement(h,{label:`${s.length}/${n.length}`,status:f.Unknown}))),e.createElement(ve,{$isFooterOpen:V,$borderRadius:"16px 0 0 16px"},S.map(t=>e.createElement(Ce,{key:t.id,onClick:()=>T(t.id)},e.createElement(v,{value:s.includes(t.id),onChange:()=>T(t.id)}),e.createElement(m,{size:y.XS},t.name))))),e.createElement(fe,{$width:"60%"},e.createElement(b,{$padding:"2px 12px"},e.createElement(m,{size:y.XS},"Configurations")),e.createElement(ve,{$isFooterOpen:V,$borderRadius:"0 16px 16px 0"},U?e.createElement(C,null):e.createElement(b,{$gap:12},e.createElement(w,{size:k.S,label:"Automatic Rollout "+(H.automaticRollout?"Enabled":"Disabled"),tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is enabled, Odigos will proactively restart workloads as needed to apply updated instrumentation. Users do not need to manually trigger rollouts after adding or removing sources. Any new pods created after enabling or disabling the agent (via automatic rollout, autoscaling, etc.) will still have the agent injected, regardless of this setting. When set to false, additional configurations related to automated rollouts or rollbacks take effect.",value:H.automaticRollout,onChange:e=>Y("automaticRollout",e)})))))),V&&e.createElement(we,null,O?e.createElement(x,{label:"Applying configurations...",icon:B,withGradient:!0,typographyProps:{size:y.XXS}}):j?e.createElement(m,{size:y.XXS,color:P.v2.colors.red[500]},j):null,e.createElement("div",{style:{width:"150px"}},e.createElement($,{variant:R.Secondary,label:"Cancel",fullWidth:!0,onClick:()=>z(!0),disabled:O})),e.createElement("div",{style:{width:"150px"}},e.createElement($,{variant:R.Primary,label:"Apply",fullWidth:!0,onClick:async()=>{N(!0);const{error:e}=await I(s,H);N(!1),e?F(e):(r([]),o())},disabled:O}))),M&&e.createElement(ue,{onDeny:()=>z(!1),onApprove:()=>{z(!1),r([]),o()}}))};var xe;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(xe||(xe={}));const $e=[{key:xe.Name,label:"Name"},{key:xe.Type,label:"Type",textAlign:"right"},{key:xe.Status,label:"Status"},{key:xe.OdigosVersion,label:"Odigos Version"},{key:xe.ConnectedSince,label:"Connected Since"},{key:xe.LastActivity,label:"Last Activity"}],Re=({tableRowsMaxHeight:n,connections:s,getConnections:r,onClickConnection:d,deleteConnection:c,getConnectionRemoteConfig:u,applyConfigurations:p})=>{const b=i(),{formatTimeAgo:m}=L(),[y,v]=t(!1),[C,w]=t(s||[]),[k,x]=t(""),$=o(async()=>{try{v(!0),w(await r()??[])}catch(e){}finally{v(!1)}},[]);l(()=>{C.length||$()},[C.length,$]);const[M,z]=t(null),[O,N]=t([]),[j,F]=t(!1),U=a(()=>C.filter(e=>!k||e.name.toLowerCase().includes(k.toLowerCase())).map(t=>({onClick:()=>d(t),isSelected:O.includes(t.id),onSelect:()=>N(e=>[...e,t.id]),onDeselect:()=>N(e=>e.filter(e=>e!==t.id)),cells:[{key:xe.Id,rawValue:t.id},{key:xe.Name,rawValue:t.name},{key:xe.Type,rawValue:t.type},{key:xe.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",l=t===g.Success?X:Z;return e.createElement(h,{status:t,label:a,leftIcon:l})})(t.status)},{key:xe.OdigosVersion,rawValue:t.odigosVersion},{key:xe.ConnectedSince,rawValue:t.connectedAt?m(t.connectedAt):"-"},{key:xe.LastActivity,rawValue:t.lastSeenAt?m(t.lastSeenAt):"-"}]})),[C,O,k]);return e.createElement(I,null,e.createElement(P,{icon:G,title:"Connections",badge:{label:C.length.toString(),status:f.Unknown},search:{placeholder:"Search by cluster name",value:k,onChange:e=>x(e)},actions:[{id:A(),type:D.Button,buttonProps:{variant:R.Secondary,size:S.S,leftIcon:K,onClick:()=>$(),disabled:y}},{id:A(),type:D.Button,buttonProps:{variant:R.Primary,size:S.S,label:"Configurations",rightIcon:J,onClick:()=>F(!0)}}]},e.createElement(V,{variant:T.Pretty,maxHeight:n,headerBackgroundColor:b.v2.colors.silver[1e3],isLoading:y,withCheckboxes:!0,columns:$e,rows:U,rowActionsPushRightPosition:j?`calc(${be} - 24px)`:void 0,getRowActions:({cells:e})=>[{id:A(),label:"Edit Configuration",rightIcon:J,onClick:async()=>{const t=e.find(e=>e.key===xe.Id)?.rawValue;t&&(N([t.toString()]),F(!0))}},{id:A(),label:"Delete Connection",rightIcon:Q,disabled:e.find(e=>e.key===xe.Status)?.rawValue===g.Success,onClick:()=>{const t=e.find(e=>e.key===xe.Id)?.rawValue;t&&z(t.toString())}}]}),j&&e.createElement(ke,{onClose:()=>F(!1),connections:C,selectedConnectionIds:O,setSelectedConnectionIds:N,getConnectionRemoteConfig:u,onApply:p}),M&&e.createElement(pe,{target:"connection",onDeny:()=>z(null),onApprove:async()=>{M&&(await c(M),$())}})))},Le=n.div`
|
|
49
|
+
`,ke=({onClose:o,connections:n,selectedConnectionIds:s,setSelectedConnectionIds:r,getConnectionRemoteConfig:L,onApply:I})=>{const P=i(),[A,D]=t(""),S=a(()=>n.filter(e=>!A||e.name.toLowerCase().includes(A.toLowerCase())),[n,A]),V=s.length>0,T=e=>{r(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[M,z]=t(!1),[O,N]=t(!1),[j,F]=t(void 0),[U,E]=t(!1),[W,q]=t(void 0),{formData:H,handleFormChange:Y,areFormValuesEqual:K,resetFormData:J}=d({automaticRollout:!0}),Q=a(()=>s.length>1||void 0!==W&&!K(W,H),[s.length,W,H]);return l(()=>{1===s.length?(async e=>{if(U)return;E(!0);const t=await L(e);if(t){const e={automaticRollout:!t.rollout?.automaticRolloutDisabled};q(e),J(e)}E(!1)})(s[0]):q(void 0)},[s.length]),e.createElement(c,{isOpen:!0,hideOverlay:!0,width:be,header:{icon:G,title:"Cluster Configuration",onClose:o}},e.createElement(me,null,e.createElement(ye,null,e.createElement(u,{width:"40%",value:A,onChange:D}),Q?e.createElement(p,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):1===s.length&&void 0!==W?e.createElement(p,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}):null),e.createElement(he,null,e.createElement(fe,{$width:"40%"},e.createElement(b,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(b,{$gap:8},e.createElement(m,{size:y.XS},"Clusters"),e.createElement(h,{label:n.length,status:f.Unknown})),e.createElement(b,{$gap:8},e.createElement(m,{size:y.XXXS,color:P.v2.colors.silver[200]},"Selected"),e.createElement(h,{label:`${s.length}/${n.length}`,status:f.Unknown}))),e.createElement(ve,{$isFooterOpen:V,$borderRadius:"16px 0 0 16px"},S.map(t=>e.createElement(Ce,{key:t.id,onClick:()=>T(t.id)},e.createElement(v,{value:s.includes(t.id),onChange:()=>T(t.id)}),e.createElement(m,{size:y.XS},t.name))))),e.createElement(fe,{$width:"60%"},e.createElement(b,{$padding:"2px 12px"},e.createElement(m,{size:y.XS},"Configurations")),e.createElement(ve,{$isFooterOpen:V,$borderRadius:"0 16px 16px 0"},U?e.createElement(C,null):e.createElement(b,{$gap:12},e.createElement(w,{size:k.S,label:"Automatic Rollout "+(H.automaticRollout?"Enabled":"Disabled"),tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is enabled, Odigos will proactively restart workloads as needed to apply updated instrumentation. Users do not need to manually trigger rollouts after adding or removing sources. Any new pods created after enabling or disabling the agent (via automatic rollout, autoscaling, etc.) will still have the agent injected, regardless of this setting. When set to false, additional configurations related to automated rollouts or rollbacks take effect.",value:H.automaticRollout,onChange:e=>Y("automaticRollout",e)})))))),V&&e.createElement(we,null,O?e.createElement(x,{label:"Applying configurations...",icon:B,withGradient:!0,typographyProps:{size:y.XXS}}):j?e.createElement(m,{size:y.XXS,color:P.v2.colors.red[500]},j):null,e.createElement("div",{style:{width:"150px"}},e.createElement($,{variant:R.Secondary,label:"Cancel",fullWidth:!0,onClick:()=>z(!0),disabled:O})),e.createElement("div",{style:{width:"150px"}},e.createElement($,{variant:R.Primary,label:"Apply",fullWidth:!0,onClick:async()=>{N(!0);const{error:e}=await I(s,H);N(!1),e?F(e):(r([]),o())},disabled:O}))),M&&e.createElement(ue,{onDeny:()=>z(!1),onApprove:()=>{z(!1),r([]),o()}}))};var xe;!function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(xe||(xe={}));const $e=[{key:xe.Name,label:"Name"},{key:xe.Type,label:"Type",textAlign:"right"},{key:xe.Status,label:"Status"},{key:xe.OdigosVersion,label:"Odigos Version"},{key:xe.ConnectedSince,label:"Connected Since"},{key:xe.LastActivity,label:"Last Activity"}],Re=({tableRowsMaxHeight:n,connections:s,getConnections:r,onClickConnection:d,deleteConnection:c,getConnectionRemoteConfig:u,applyConfigurations:p})=>{const b=i(),{formatTimeAgo:m}=L(),[y,v]=t(!1),[C,w]=t(s||[]),[k,x]=t(""),$=o(async()=>{try{v(!0),w(await r()??[])}catch(e){}finally{v(!1)}},[]);l(()=>{C.length||$()},[C.length,$]);const[M,z]=t(null),[O,N]=t([]),[j,F]=t(!1),U=a(()=>C.filter(e=>!k||e.name.toLowerCase().includes(k.toLowerCase())).map(t=>({onClick:()=>d(t),isSelected:O.includes(t.id),onSelect:()=>N(e=>[...e,t.id]),onDeselect:()=>N(e=>e.filter(e=>e!==t.id)),cells:[{key:xe.Id,rawValue:t.id},{key:xe.Name,rawValue:t.name},{key:xe.Type,rawValue:t.type},{key:xe.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",l=t===g.Success?X:Z;return e.createElement(h,{status:t,label:a,leftIcon:l})})(t.status)},{key:xe.OdigosVersion,rawValue:t.odigosVersion},{key:xe.ConnectedSince,rawValue:t.connectedAt?m(t.connectedAt):"-"},{key:xe.LastActivity,rawValue:t.lastSeenAt?m(t.lastSeenAt):"-"}]})),[C,O,k]);return e.createElement(I,null,e.createElement(P,{icon:G,title:"Connections",badge:{label:C.length.toString(),status:f.Unknown},search:{placeholder:"Search by cluster name",value:k,onChange:e=>x(e)},actions:[{id:A(),type:D.Button,buttonProps:{variant:R.Secondary,size:S.S,leftIcon:K,onClick:()=>$(),disabled:y}},{id:A(),type:D.Button,buttonProps:{variant:R.Primary,size:S.S,label:"Configurations",rightIcon:J,onClick:()=>F(!0)}}]},e.createElement(V,{variant:T.Pretty,maxHeight:n,headerBackgroundColor:b.v2.colors.silver[1e3],isLoading:y,withCheckboxes:!0,columns:$e,rows:U,rowActionsPushRightPosition:j?`calc(${be} - 24px)`:void 0,getRowActions:({cells:e})=>[{id:A(),label:"Edit Configuration",rightIcon:J,onClick:async()=>{const t=e.find(e=>e.key===xe.Id)?.rawValue;t&&(N([t.toString()]),F(!0))}},{id:A(),label:"Delete Connection",rightIcon:Q,disabled:e.find(e=>e.key===xe.Status)?.rawValue===g.Success,onClick:()=>{const t=e.find(e=>e.key===xe.Id)?.rawValue;t&&z(t.toString())}}]}),j&&e.createElement(ke,{onClose:()=>F(!1),connections:C,selectedConnectionIds:O,setSelectedConnectionIds:N,getConnectionRemoteConfig:u,onApply:p}),M&&e.createElement(pe,{target:"connection",onDeny:()=>z(null),onApprove:async()=>{M&&(await c(M),z(null),$())}})))},Le=n.div`
|
|
50
50
|
display: flex;
|
|
51
51
|
align-items: center;
|
|
52
52
|
justify-content: space-between;
|