@e-llm-studio/instant-learning 1.3.0-alpha.4 → 1.3.0-alpha.6

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.
@@ -1,2 +1,2 @@
1
- import{__spreadArray as e,__assign as t}from"tslib";import{jsxs as i,jsx as o}from"react/jsx-runtime";import{useMemo as n,useEffect as r}from"react";import{AuditLog as l}from"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import{User as a,FileText as d,ExternalLink as c}from"lucide-react";var s=function(s){var h=s.configId,p=s.ruleData,g=s.scopeId,u=s.scopeName,f=(null==u?void 0:u.trim())||"Selected",m=n(function(){var t,i,o=[];g&&o.push(g);var n=(null===(t=null==p?void 0:p.data)||void 0===t?void 0:t.tier1)||(null==p?void 0:p.tier1)||[],r=(null===(i=null==p?void 0:p.data)||void 0===i?void 0:i.tier2)||(null==p?void 0:p.tier2)||[];return e(e([],n,!0),r,!0).forEach(function(e){(null==e?void 0:e.ruleId)&&o.push(e.ruleId),(null==e?void 0:e.variants)&&Array.isArray(e.variants)&&e.variants.forEach(function(e){(null==e?void 0:e.variantId)&&o.push(e.variantId)})}),o},[p,g]);return r(function(){console.log("Flattened External Resource IDs:",m)},[m]),i("div",t({style:{padding:"24px",fontFamily:"Arial, sans-serif"}},{children:[i("div",t({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[i("h1",t({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:[f," - Audit Log"]})),i("p",t({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:["Track all learning updates and modifications with the ",f," scope."]}))]})),o(l,{configId:h,getData:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/fetch"},distinctValuesApi:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/distinct-values"},query:{externalResourceId:m.length>0?m:[""],paginationLimit:10},sidebar:{config:{showAnalystFilter:!0,showDateFilter:!0,showChangeTitleFilter:!0,showImpactPercentage:!1},labels:{title:"Filters",multiSelectLabel:"Modified By",multiSelectHint:"Filter by the user who made the change",changeTitleLabel:"Change Action",changeTitleHint:"Filter by Actions"}},table:{tableProps:{scrollable:!0,scrollHeight:"80vh",showGridlines:!0,size:"small",rowClassName:function(){return"custom-compact-row"},pt:{bodyCell:{style:{paddingTop:"4px",paddingBottom:"4px"}}}},hiddenColumns:["actions","changeSummary","changeDateTime","logId"],extraColumns:[{key:"modifiedBy",header:"Modified By",body:function(e){return i("div",t({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[o(a,{size:16,color:"#64748b",style:{flexShrink:0}}),o("span",t({style:{fontWeight:500}},{children:e.modifiedBy}))]}))},style:{width:"15%",minWidth:"140px"}},{key:"changeAction",header:"Action",body:function(e){var i,n,r=(i=e.changeTitle,(n=(i||"").toUpperCase()).includes("CREATE")?{color:"#2e7d32",backgroundColor:"#edf7ed",borderColor:"#c8e6c9",boxShadow:"0 1px 2px rgba(46, 125, 50, 0.08)"}:n.includes("UPDATE")||n.includes("TOGGLE")?{color:"#1565c0",backgroundColor:"#e3f2fd",borderColor:"#bbdefb",boxShadow:"0 1px 2px rgba(21, 101, 192, 0.08)"}:n.includes("DELETE")?{color:"#c62828",backgroundColor:"#fdeeed",borderColor:"#ffcdd2",boxShadow:"0 1px 2px rgba(198, 40, 40, 0.08)"}:{color:"#475569",backgroundColor:"#f8fafc",borderColor:"#cbd5e1",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.06)"}),l=e.changeTitle?e.changeTitle.replace(/_/g," "):"—";return o("span",t({style:{color:r.color,backgroundColor:r.backgroundColor,border:"1px solid ".concat(r.borderColor),boxShadow:r.boxShadow,padding:"6px 12px",borderRadius:"999px",fontSize:"12px",lineHeight:1,fontWeight:600,display:"inline-block",minWidth:"76px",textAlign:"center",textTransform:"capitalize"}},{children:l}))},style:{width:"15%",textAlign:"center"}},{key:"customChangeSummary",header:"Change Summary",body:function(e){var n;return i("div",t({style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"4px 0"}},{children:[o(d,{size:16,color:"#94a3b8",style:{flexShrink:0,marginTop:"2px"}}),o("span",t({style:{color:"#334155",fontSize:"13px",lineHeight:1.5}},{children:null!==(n=e.actionText)&&void 0!==n?n:"—"}))]}))},style:{width:"30%",minWidth:"200px"}},{key:"redirectLink",header:"Link",body:function(e){var n,r=(null===(n=e.metadata)||void 0===n?void 0:n.redirect_url)||e.redirect_url;return r?o("div",t({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:i("a",t({href:r,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"6px",color:"#2563eb",textDecoration:"none",fontWeight:500,fontSize:"13px"}},{children:["View ",o(c,{size:14})]}))})):o("span",t({style:{color:"#94a3b8",display:"flex",justifyContent:"center"}},{children:"—"}))},style:{width:"10%",minWidth:"90px",textAlign:"center"}},{key:"customChangeDateTime",header:"Change Time and Date",body:function(e){if(!e.actionDate)return o("span",t({style:{color:"#94a3b8"}},{children:"—"}));var n=new Date(e.actionDate),r=n.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}),l=n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return i("div",t({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",fontSize:"13px",color:"#475569"}},{children:[o("span",t({style:{fontWeight:500}},{children:r})),o("span",{children:l})]}))},style:{width:"15%",minWidth:"150px",textAlign:"center"}}]},filters:{config:{showFilterButton:!0,showSort:!0,showDate:!0,showSearch:!0,sortOptions:{latest:!0,oldest:!0,impactHighToLow:!1,impactLowToHigh:!1}}}})]}))};export{s as default};
1
+ import{__assign as e}from"tslib";import{jsxs as t,jsx as i}from"react/jsx-runtime";import{useMemo as o,useEffect as n}from"react";import{AuditLog as r}from"@e-llm-studio/audit-log";import"@e-llm-studio/audit-log/dist/styles.css";import{User as l,FileText as a,ExternalLink as d}from"lucide-react";var c=function(c){var s=c.configId,h=c.ruleData,p=c.scopeId,g=c.scopeName,u=(null==g?void 0:g.trim())||"Selected",m=o(function(){var e=[];return p&&e.push(p),e},[h,p]);return n(function(){console.log("Flattened External Resource IDs:",m)},[m]),t("div",e({style:{padding:"24px",fontFamily:"Arial, sans-serif"}},{children:[t("div",e({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[t("h1",e({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:[u," - Audit Log"]})),t("p",e({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:["Track all learning updates and modifications with the ",u," scope."]}))]})),i(r,{configId:s,getData:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/fetch"},distinctValuesApi:{baseUrl:"https://dev.appmod.ai",endpoint:"/changelog/audit-log/distinct-values"},query:{externalResourceId:m.length>0?m:[""],paginationLimit:10},sidebar:{config:{showAnalystFilter:!0,showDateFilter:!0,showChangeTitleFilter:!0,showImpactPercentage:!1},labels:{title:"Filters",multiSelectLabel:"Modified By",multiSelectHint:"Filter by the user who made the change",changeTitleLabel:"Change Action",changeTitleHint:"Filter by Actions"}},table:{tableProps:{scrollable:!0,scrollHeight:"80vh",showGridlines:!0,size:"small",rowClassName:function(){return"custom-compact-row"},pt:{bodyCell:{style:{paddingTop:"4px",paddingBottom:"4px"}}}},hiddenColumns:["actions","changeSummary","changeDateTime","logId"],extraColumns:[{key:"modifiedBy",header:"Modified By",body:function(o){return t("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[i(l,{size:16,color:"#64748b",style:{flexShrink:0}}),i("span",e({style:{fontWeight:500}},{children:o.modifiedBy}))]}))},style:{width:"15%",minWidth:"140px"}},{key:"changeAction",header:"Action",body:function(t){var o,n,r=(o=t.changeTitle,(n=(o||"").toUpperCase()).includes("CREATE")?{color:"#2e7d32",backgroundColor:"#edf7ed",borderColor:"#c8e6c9",boxShadow:"0 1px 2px rgba(46, 125, 50, 0.08)"}:n.includes("UPDATE")||n.includes("TOGGLE")?{color:"#1565c0",backgroundColor:"#e3f2fd",borderColor:"#bbdefb",boxShadow:"0 1px 2px rgba(21, 101, 192, 0.08)"}:n.includes("DELETE")?{color:"#c62828",backgroundColor:"#fdeeed",borderColor:"#ffcdd2",boxShadow:"0 1px 2px rgba(198, 40, 40, 0.08)"}:{color:"#475569",backgroundColor:"#f8fafc",borderColor:"#cbd5e1",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.06)"}),l=t.changeTitle?t.changeTitle.replace(/_/g," "):"—";return i("span",e({style:{color:r.color,backgroundColor:r.backgroundColor,border:"1px solid ".concat(r.borderColor),boxShadow:r.boxShadow,padding:"6px 12px",borderRadius:"999px",fontSize:"12px",lineHeight:1,fontWeight:600,display:"inline-block",minWidth:"76px",textAlign:"center",textTransform:"capitalize"}},{children:l}))},style:{width:"15%",textAlign:"center"}},{key:"customChangeSummary",header:"Change Summary",body:function(o){var n;return t("div",e({style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"4px 0"}},{children:[i(a,{size:16,color:"#94a3b8",style:{flexShrink:0,marginTop:"2px"}}),i("span",e({style:{color:"#334155",fontSize:"13px",lineHeight:1.5}},{children:null!==(n=o.actionText)&&void 0!==n?n:"—"}))]}))},style:{width:"30%",minWidth:"200px"}},{key:"redirectLink",header:"Link",body:function(o){var n,r=(null===(n=o.metadata)||void 0===n?void 0:n.redirect_url)||o.redirect_url;return r?i("div",e({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:t("a",e({href:r,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"6px",color:"#2563eb",textDecoration:"none",fontWeight:500,fontSize:"13px"}},{children:["View ",i(d,{size:14})]}))})):i("span",e({style:{color:"#94a3b8",display:"flex",justifyContent:"center"}},{children:"—"}))},style:{width:"10%",minWidth:"90px",textAlign:"center"}},{key:"customChangeDateTime",header:"Change Time and Date",body:function(o){if(!o.actionDate)return i("span",e({style:{color:"#94a3b8"}},{children:"—"}));var n=new Date(o.actionDate),r=n.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}),l=n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return t("div",e({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",fontSize:"13px",color:"#475569"}},{children:[i("span",e({style:{fontWeight:500}},{children:r})),i("span",{children:l})]}))},style:{width:"15%",minWidth:"150px",textAlign:"center"}}]},filters:{config:{showFilterButton:!0,showSort:!0,showDate:!0,showSearch:!0,sortOptions:{latest:!0,oldest:!0,impactHighToLow:!1,impactLowToHigh:!1}}}})]}))};export{c as default};
2
2
  //# sourceMappingURL=AuditLog.js.map