@e-llm-studio/instant-learning 1.3.0-alpha.53 → 1.3.0-alpha.54
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/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +1 -1
- package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
- package/dist/cjs/features/LearningManagement/AuditLog/AuditLog.js +1 -1
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +1 -1
- package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js +1 -1
- package/dist/features/LearningManagement/AuditLog/AuditLog.js +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts.map +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/AuditLog/AuditLog.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),r=require("./TeachMeWrapper.js"),a=require("../../../plugins/ValueTypes/Default/DefaultTeachMeRenderer.js"),i=require("../../../plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js"),s=require("../../../plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js"),u=require("../../LearningManagement/store/useLMSConfigStore.js"),l=require("../../LearningManagement/store/useLearningTemplateStore.js"),o=require("../../LearningManagement/queries/useLMSConfigQuery.js"),g=require("../../LearningManagement/store/useAuthStore.js"),c=require("../../LearningManagement/store/useEnvStore.js"),f=require("@tanstack/react-query"),d=require("../../LearningManagement/apis/scopeApis.js"),p={Default:a.default,"Radio Traffic Learning":i.default,Guidelines:s.default},M=new f.QueryClient,S=function(a){var i,s=a.app_integration_id,f=a.isOpen,M=a.onClose,S=a.pluginPayload,L=a.token,T=a.mode,m=a.baseURL,_=u.useTeachMeConfigStore(function(e){return e.setTeachMeConfig});u.useTeachMeConfigStore(function(e){return e.clearTeachMeConfig});var h=u.useLMSConfigStore(function(e){return e.setLMSConfig});t.useEffect(function(){g.default.getState().setUser({accessToken:L}),c.default.getState().setLlmStudioUrl(m),l.useLearningTemplateStore.getState().setAppIntegrationId(null!=s?s:""),L&&m&&((null==S?void 0:S.tiers)||d.fetchTiers())},[s,L,m]),null==S||S.teachMe;var q=o.useLMSConfigQuery(null!=s?s:"",!1,!0);return q.isLoading,q.isError,q.refetch,q.isSuccess,t.useEffect(function(){var n;if(null==S?void 0:S.teachMe){var t=S.teachMe;t.teachMe&&_(t.teachMe),t.template&&l.useLearningTemplateStore.getState().setTemplateData(null!=s?s:"",t.template),t.learningManagement&&h(e.__assign(e.__assign({},t.learningManagement),{agents:null!==(n=t.agents)&&void 0!==n?n:{}}))}(null==S?void 0:S.tiers)&&l.useLearningTemplateStore.getState().setTiers(S.tiers)},[S]),n.jsx(r.default,{app_integration_id:s,isOpen:f,onClose:M,token:L,templateRegistry:p,baseURL:m,initialScope:null!==(i=null==S?void 0:S.initialScope)&&void 0!==i?i:"",ruleSet:null==S?void 0:S.ruleSet,pluginPayload:e.__assign(e.__assign({},S),{mode:T})})};exports.TemplateRegistry=p,exports.default=function(t){return n.jsx(f.QueryClientProvider,e.__assign({client:M},{children:n.jsx(S,e.__assign({},t))}))};
|
|
2
2
|
//# sourceMappingURL=TeachMePlugin.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),a=require("@mui/material"),n=require("@mui/icons-material/Close"),i=require("../../LearningManagement/store/useLearningTemplateStore.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(n),l=function(){var n=r.useState(!0),i=n[0],o=n[1];return t.jsxs(a.Dialog,e.__assign({open:i,onClose:function(){return o(!1)},fullWidth:!0,maxWidth:"lg",PaperProps:{sx:{borderRadius:"16px",minHeight:"70vh",overflow:"hidden"}}},{children:[t.jsxs(a.DialogTitle,e.__assign({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",px:3,py:2}},{children:[t.jsx(a.Typography,e.__assign({variant:"h6",fontWeight:600},{children:"Teach Me"})),t.jsx(a.IconButton,e.__assign({onClick:function(){return o(!1)}},{children:t.jsx(s.default,{})}))]})),t.jsx(a.DialogContent,e.__assign({dividers:!0,sx:{p:3,backgroundColor:"#fafafa"}},{children:"There is some issue with the selected template. Kindly check steps to resolve."}))]}))};exports.default=function(n){var o=n.templateRegistry,s=void 0===o?{}:o,u=i.useLearningTemplateStore(function(e){return e.backwardCompatibility}),c=i.useLearningTemplateStore(function(e){return n.app_integration_id?e.templateMap[n.app_integration_id]:void 0}),d=i.useLearningTemplateStore(function(e){return e.setTemplateData}),p=u?"Radio Traffic Learning":c,_=r.useState(!p),f=_[0],g=_[1],h=r.useState(!1),v=h[0],m=h[1];if(r.useEffect(function(){var t,r;if(n.isOpen){if(!u&&!n.app_integration_id)return console.error("TeachMeWrapper requires an app_integration_id when backward compatibility is disabled."),m(!0),void g(!1);if(null===(r=null===(t=n.pluginPayload)||void 0===t?void 0:t.teachMe)||void 0===r?void 0:r.template)return d(n.app_integration_id,n.pluginPayload.teachMe.template),void g(!1);if(p)g(!1);else{e.__awaiter(void 0,void 0,void 0,function(){var t,r;return e.__generator(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),g(!0),m(!1),[4,(i=n.app_integration_id,o=n.token,e.__awaiter(void 0,void 0,void 0,function(){var t,r;return e.__generator(this,function(e){switch(e.label){case 0:return[4,fetch("".concat(n.baseURL,"/instant_learning/ilotj/application/getValueType/").concat(i),{headers:{Authorization:"Bearer ".concat(o)}})];case 1:if(!(t=e.sent()).ok)throw new Error("Failed to fetch value type");return[4,t.json()];case 2:return r=e.sent(),console.log("Fetched value type data:",r),!r||Array.isArray(r.data)&&0===r.data.length?[2,null]:[2,r.data[0].value_type_name||r.valueTypeName||r.templateName]}})}))];case 1:return t=a.sent(),d(n.app_integration_id,t),[3,4];case 2:return r=a.sent(),console.error(r),m(!0),n.app_integration_id&&d(n.app_integration_id,"ERROR"),[3,4];case 3:return g(!1),[7];case 4:return[2]}var i,o})})}}},[n.isOpen,n.app_integration_id,p,n.token,d,u]),f)return t.jsx(a.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:t.jsx(a.CircularProgress,{size:32})}));if(v||!p)return t.jsx(l,{});var x=s[p&&s[p]?p:"Default"];return x?t.jsx(x,e.__assign({},n)):(console.warn("No renderer found for template: ".concat(p)),t.jsx(l,{}))};
|
|
2
2
|
//# sourceMappingURL=TeachMeWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),o=require("@e-llm-studio/audit-log");require("@e-llm-studio/audit-log/dist/styles.css");var n=require("lucide-react"),a=require("./ChangeLogDiff.js"),s=require("../store/useLMSConfigStore.js"),r=require("../RBAC/AccessPanel.module.css.js"),l=require("../store/usePermissionsStore.js"),c=require("../store/useEnvStore.js"),d=require("../store/useConfigStore.js");exports.default=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),o=require("@e-llm-studio/audit-log");require("@e-llm-studio/audit-log/dist/styles.css");var n=require("lucide-react"),a=require("./ChangeLogDiff.js"),s=require("../store/useLMSConfigStore.js"),r=require("../RBAC/AccessPanel.module.css.js"),l=require("../store/usePermissionsStore.js"),c=require("../store/useEnvStore.js"),d=require("../store/useConfigStore.js");exports.default=function(g){var u=g.configId,p=g.ruleData,h=g.scopeId,x=g.scopeName,f=(null==x?void 0:x.trim())||"Selected",m=i.useState("scope"),b=m[0],y=m[1];d.useConfigStore.getState().configuration;var v=l.usePermissionsStore(function(e){return e.hasPermission}),_=c.default(function(e){var t;return(null===(t=e.rbacConfig)||void 0===t?void 0:t.applicationResourceId)||""}),w=Boolean(h&&v("ilotj.scope.changeLog.view",h)),j=Boolean(_&&v("ilotj.application.changeLog.view",_)),S=i.useMemo(function(){var e=[];return h&&e.push(h),e},[p,h]);i.useEffect(function(){console.log("Flattened External Resource IDs:",S)},[S]);var C={configId:u,getData:{baseUrl:window.location.origin.includes("local")?"https://dev.appmod.ai":window.location.origin,endpoint:"/changelog/audit-log/fetch"},distinctValuesApi:{baseUrl:window.location.origin.includes("local")?"https://dev.appmod.ai":window.location.origin,endpoint:"/changelog/audit-log/distinct-values"},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(i){return t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t.jsx(n.User,{size:16,color:"#64748b",style:{flexShrink:0}}),t.jsx("span",e.__assign({style:{fontWeight:500}},{children:i.modifiedBy}))]}))},style:{width:"15%",minWidth:"140px"}},{key:"changeAction",header:"Action",body:function(i){var o,n,a=(o=i.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)"}),s=i.changeTitle?i.changeTitle.replace(/_/g," "):"—";return t.jsx("span",e.__assign({style:{color:a.color,backgroundColor:a.backgroundColor,border:"1px solid ".concat(a.borderColor),boxShadow:a.boxShadow,padding:"6px 12px",borderRadius:"999px",fontSize:"12px",lineHeight:1,fontWeight:600,display:"inline-block",minWidth:"76px",textAlign:"center",textTransform:"capitalize"}},{children:s}))},style:{width:"15%",textAlign:"center"}},{key:"customChangeSummary",header:"Change Summary",body:function(e){var i;return t.jsx(a.default,{change:null!==(i=e.actionText)&&void 0!==i?i:"-"})},style:{width:"30%",minWidth:"200px"}},{key:"redirectLink",header:"Link",body:function(i){var o,a=(null===(o=i.metadata)||void 0===o?void 0:o.redirect_url)||i.redirect_url;return a?t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:t.jsxs("a",e.__assign({href:a,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"6px",color:"#2563eb",textDecoration:"none",fontWeight:500,fontSize:"13px"}},{children:["View ",t.jsx(n.ExternalLink,{size:14})]}))})):t.jsx("span",e.__assign({style:{color:"#94a3b8",display:"flex",justifyContent:"center"}},{children:"—"}))},style:{width:"10%",minWidth:"90px",textAlign:"center"}},{key:"customChangeDateTime",header:"Change Time and Date",body:function(i){if(!i.actionDate)return t.jsx("span",e.__assign({style:{color:"#94a3b8"}},{children:"—"}));var o=new Date(i.actionDate),n=o.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}),a=o.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",fontSize:"13px",color:"#475569"}},{children:[t.jsx("span",e.__assign({style:{fontWeight:500}},{children:n})),t.jsx("span",{children:a})]}))},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}}}};return t.jsx("div",e.__assign({style:{height:"100%",overflowY:"auto"}},{children:t.jsxs("div",e.__assign({style:{padding:"24px",fontFamily:"Arial, sans-serif"}},{children:[t.jsxs("div",e.__assign({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[t.jsx("h1",e.__assign({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:s.dt("history.title","".concat(f," - Audit Log"),{scope_name:f})})),t.jsx("p",e.__assign({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:s.dt("history.subtitle","Track all learning updates and modifications with the ".concat(f," scope."),{scope_name:f})}))]})),t.jsxs("div",e.__assign({className:r.default.accessTabs,role:"tablist","aria-label":"Audit log level"},{children:[t.jsx("button",e.__assign({type:"button",role:"tab","aria-selected":"scope"===b,className:"".concat(r.default.accessTab," ").concat("scope"===b?r.default.accessTabActive:""),onClick:function(){return y("scope")},disabled:!w,title:w?"":"You do not have permission to view scope level change log"},{children:s.dt("history.scopeLevel","Scope Level")})),t.jsx("button",e.__assign({type:"button",role:"tab","aria-selected":"application"===b,className:"".concat(r.default.accessTab," ").concat("application"===b?r.default.accessTabActive:""),onClick:function(){return y("application")},disabled:!j,title:j?"":"You do not have permission to view application level change log"},{children:s.dt("history.applicationLevel","Application Level")}))]})),"scope"===b?t.jsx(o.AuditLog,e.__assign({},C,{query:{externalResourceId:S.length>0?S:[""],paginationLimit:10}}),"scope-audit-log"):t.jsx(o.AuditLog,e.__assign({},C,{query:{externalResourceId:[],paginationLimit:10}}),"application-audit-log")]}))}))};
|
|
2
2
|
//# sourceMappingURL=AuditLog.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t}from"react/jsx-runtime";import{useEffect as n}from"react";import r from"./TeachMeWrapper.js";import a from"../../../plugins/ValueTypes/Default/DefaultTeachMeRenderer.js";import i from"../../../plugins/ValueTypes/RadioTrafficLearning/RadioTrafficLearningRenderer.js";import o from"../../../plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js";import{useTeachMeConfigStore as s,useLMSConfigStore as l}from"../../LearningManagement/store/useLMSConfigStore.js";import{useLearningTemplateStore as u}from"../../LearningManagement/store/useLearningTemplateStore.js";import{useLMSConfigQuery as m}from"../../LearningManagement/queries/useLMSConfigQuery.js";import p from"../../LearningManagement/store/useAuthStore.js";import g from"../../LearningManagement/store/useEnvStore.js";import{QueryClient as f,QueryClientProvider as c}from"@tanstack/react-query";import{fetchTiers as d}from"../../LearningManagement/apis/scopeApis.js";var M={Default:a,"Radio Traffic Learning":i,Guidelines:o},S=new f,L=function(n){return t(c,e({client:S},{children:t(T,e({},n))}))},T=function(a){var i,o=a.app_integration_id,f=a.isOpen,c=a.onClose,S=a.pluginPayload,L=a.token,T=a.mode,v=a.baseURL,h=s(function(e){return e.setTeachMeConfig});s(function(e){return e.clearTeachMeConfig});var j=l(function(e){return e.setLMSConfig});n(function(){p.getState().setUser({accessToken:L}),g.getState().setLlmStudioUrl(v),u.getState().setAppIntegrationId(null!=o?o:""),L&&v&&((null==S?void 0:S.tiers)||d())},[o,L,v]),null==S||S.teachMe;var R=m(null!=o?o:"",!1,!0);return R.isLoading,R.isError,R.refetch,R.isSuccess,n(function(){var t;if(null==S?void 0:S.teachMe){var n=S.teachMe;n.teachMe&&h(n.teachMe),n.template&&u.getState().setTemplateData(null!=o?o:"",n.template),n.learningManagement&&j(e(e({},n.learningManagement),{agents:null!==(t=n.agents)&&void 0!==t?t:{}}))}(null==S?void 0:S.tiers)&&u.getState().setTiers(S.tiers)},[S]),t(r,{app_integration_id:o,isOpen:f,onClose:c,token:L,templateRegistry:M,baseURL:v,initialScope:null!==(i=null==S?void 0:S.initialScope)&&void 0!==i?i:"",ruleSet:null==S?void 0:S.ruleSet,pluginPayload:e(e({},S),{mode:T})})};export{M as TemplateRegistry,L as default};
|
|
2
2
|
//# sourceMappingURL=TeachMePlugin.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as i}from"tslib";import{jsx as r,jsxs as n}from"react/jsx-runtime";import{useState as a,useEffect as o}from"react";import{Box as l,CircularProgress as s,Dialog as p,DialogTitle as c,Typography as d,IconButton as u,DialogContent as f}from"@mui/material";import m from"@mui/icons-material/Close";import{useLearningTemplateStore as h}from"../../LearningManagement/store/useLearningTemplateStore.js";var v=function(){var t=a(!0),i=t[0],o=t[1];return n(p,e({open:i,onClose:function(){return o(!1)},fullWidth:!0,maxWidth:"lg",PaperProps:{sx:{borderRadius:"16px",minHeight:"70vh",overflow:"hidden"}}},{children:[n(c,e({sx:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",px:3,py:2}},{children:[r(d,e({variant:"h6",fontWeight:600},{children:"Teach Me"})),r(u,e({onClick:function(){return o(!1)}},{children:r(m,{})}))]})),r(f,e({dividers:!0,sx:{p:3,backgroundColor:"#fafafa"}},{children:"There is some issue with the selected template. Kindly check steps to resolve."}))]}))},g=function(n){var p=n.templateRegistry,c=void 0===p?{}:p,d=h(function(e){return e.backwardCompatibility}),u=h(function(e){return n.app_integration_id?e.templateMap[n.app_integration_id]:void 0}),f=h(function(e){return e.setTemplateData}),m=d?"Radio Traffic Learning":u,g=a(!m),_=g[0],y=g[1],b=a(!1),x=b[0],w=b[1];if(o(function(){var e,r;if(n.isOpen){if(!d&&!n.app_integration_id)return console.error("TeachMeWrapper requires an app_integration_id when backward compatibility is disabled."),w(!0),void y(!1);if(null===(r=null===(e=n.pluginPayload)||void 0===e?void 0:e.teachMe)||void 0===r?void 0:r.template)return f(n.app_integration_id,n.pluginPayload.teachMe.template),void y(!1);if(m)y(!1);else{t(void 0,void 0,void 0,function(){var e,r;return i(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),y(!0),w(!1),[4,(o=n.app_integration_id,l=n.token,t(void 0,void 0,void 0,function(){var e,t;return i(this,function(i){switch(i.label){case 0:return[4,fetch("".concat(n.baseURL,"/instant_learning/ilotj/application/getValueType/").concat(o),{headers:{Authorization:"Bearer ".concat(l)}})];case 1:if(!(e=i.sent()).ok)throw new Error("Failed to fetch value type");return[4,e.json()];case 2:return t=i.sent(),console.log("Fetched value type data:",t),!t||Array.isArray(t.data)&&0===t.data.length?[2,null]:[2,t.data[0].value_type_name||t.valueTypeName||t.templateName]}})}))];case 1:return e=a.sent(),f(n.app_integration_id,e),[3,4];case 2:return r=a.sent(),console.error(r),w(!0),n.app_integration_id&&f(n.app_integration_id,"ERROR"),[3,4];case 3:return y(!1),[7];case 4:return[2]}var o,l})})}}},[n.isOpen,n.app_integration_id,m,n.token,f,d]),_)return r(l,e({sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},{children:r(s,{size:32})}));if(x||!m)return r(v,{});var k=c[m&&c[m]?m:"Default"];return k?r(k,e({},n)):(console.warn("No renderer found for template: ".concat(m)),r(v,{}))};export{g as default};
|
|
2
2
|
//# sourceMappingURL=TeachMeWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as i,useMemo as n,useEffect as a}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,ExternalLink as c}from"lucide-react";import s from"./ChangeLogDiff.js";import{dt as d}from"../store/useLMSConfigStore.js";import p from"../RBAC/AccessPanel.module.css.js";import{usePermissionsStore as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as i,useMemo as n,useEffect as a}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,ExternalLink as c}from"lucide-react";import s from"./ChangeLogDiff.js";import{dt as d}from"../store/useLMSConfigStore.js";import p from"../RBAC/AccessPanel.module.css.js";import{usePermissionsStore as h}from"../store/usePermissionsStore.js";import g from"../store/useEnvStore.js";import{useConfigStore as u}from"../store/useConfigStore.js";var m=function(m){var f=m.configId,b=m.ruleData,y=m.scopeId,x=m.scopeName,v=(null==x?void 0:x.trim())||"Selected",w=i("scope"),C=w[0],S=w[1];u.getState().configuration;var T=h(function(e){return e.hasPermission}),L=g(function(e){var o;return(null===(o=e.rbacConfig)||void 0===o?void 0:o.applicationResourceId)||""}),A=Boolean(y&&T("ilotj.scope.changeLog.view",y)),k=Boolean(L&&T("ilotj.application.changeLog.view",L)),D=n(function(){var e=[];return y&&e.push(y),e},[b,y]);a(function(){console.log("Flattened External Resource IDs:",D)},[D]);var I={configId:f,getData:{baseUrl:window.location.origin.includes("local")?"https://dev.appmod.ai":window.location.origin,endpoint:"/changelog/audit-log/fetch"},distinctValuesApi:{baseUrl:window.location.origin.includes("local")?"https://dev.appmod.ai":window.location.origin,endpoint:"/changelog/audit-log/distinct-values"},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(i){return o("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t(l,{size:16,color:"#64748b",style:{flexShrink:0}}),t("span",e({style:{fontWeight:500}},{children:i.modifiedBy}))]}))},style:{width:"15%",minWidth:"140px"}},{key:"changeAction",header:"Action",body:function(o){var i,n,a=(i=o.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)"}),r=o.changeTitle?o.changeTitle.replace(/_/g," "):"—";return t("span",e({style:{color:a.color,backgroundColor:a.backgroundColor,border:"1px solid ".concat(a.borderColor),boxShadow:a.boxShadow,padding:"6px 12px",borderRadius:"999px",fontSize:"12px",lineHeight:1,fontWeight:600,display:"inline-block",minWidth:"76px",textAlign:"center",textTransform:"capitalize"}},{children:r}))},style:{width:"15%",textAlign:"center"}},{key:"customChangeSummary",header:"Change Summary",body:function(e){var o;return t(s,{change:null!==(o=e.actionText)&&void 0!==o?o:"-"})},style:{width:"30%",minWidth:"200px"}},{key:"redirectLink",header:"Link",body:function(i){var n,a=(null===(n=i.metadata)||void 0===n?void 0:n.redirect_url)||i.redirect_url;return a?t("div",e({style:{display:"flex",justifyContent:"center",alignItems:"center"}},{children:o("a",e({href:a,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"6px",color:"#2563eb",textDecoration:"none",fontWeight:500,fontSize:"13px"}},{children:["View ",t(c,{size:14})]}))})):t("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(i){if(!i.actionDate)return t("span",e({style:{color:"#94a3b8"}},{children:"—"}));var n=new Date(i.actionDate),a=n.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}),r=n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return o("div",e({style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",fontSize:"13px",color:"#475569"}},{children:[t("span",e({style:{fontWeight:500}},{children:a})),t("span",{children:r})]}))},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}}}};return t("div",e({style:{height:"100%",overflowY:"auto"}},{children:o("div",e({style:{padding:"24px",fontFamily:"Arial, sans-serif"}},{children:[o("div",e({style:{marginBottom:"16px",paddingBottom:"4px"}},{children:[t("h1",e({style:{margin:0,color:"#334155",fontSize:"20px",fontWeight:700,lineHeight:1.25}},{children:d("history.title","".concat(v," - Audit Log"),{scope_name:v})})),t("p",e({style:{margin:"8px 0 0",color:"#667085",fontSize:"16px",fontWeight:500,lineHeight:1}},{children:d("history.subtitle","Track all learning updates and modifications with the ".concat(v," scope."),{scope_name:v})}))]})),o("div",e({className:p.accessTabs,role:"tablist","aria-label":"Audit log level"},{children:[t("button",e({type:"button",role:"tab","aria-selected":"scope"===C,className:"".concat(p.accessTab," ").concat("scope"===C?p.accessTabActive:""),onClick:function(){return S("scope")},disabled:!A,title:A?"":"You do not have permission to view scope level change log"},{children:d("history.scopeLevel","Scope Level")})),t("button",e({type:"button",role:"tab","aria-selected":"application"===C,className:"".concat(p.accessTab," ").concat("application"===C?p.accessTabActive:""),onClick:function(){return S("application")},disabled:!k,title:k?"":"You do not have permission to view application level change log"},{children:d("history.applicationLevel","Application Level")}))]})),"scope"===C?t(r,e({},I,{query:{externalResourceId:D.length>0?D:[""],paginationLimit:10}}),"scope-audit-log"):t(r,e({},I,{query:{externalResourceId:[],paginationLimit:10}}),"application-audit-log")]}))}))};export{m as default};
|
|
2
2
|
//# sourceMappingURL=AuditLog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeachMePlugin.d.ts","sourceRoot":"","sources":["../../../../../../src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAuB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAYvE,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,sGAAsG;IACtG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,IAAI,EAAE,WAAW,CAAC;CACnB;AAGD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAM1E,CAAC;AAuBF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAM/C,CAAC;
|
|
1
|
+
{"version":3,"file":"TeachMePlugin.d.ts","sourceRoot":"","sources":["../../../../../../src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAuB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAYvE,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,sGAAsG;IACtG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,IAAI,EAAE,WAAW,CAAC;CACnB;AAGD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAM1E,CAAC;AAuBF,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAM/C,CAAC;AAmDF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeachMeWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.tsx"],"names":[],"mappings":";AA4LA,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC;CAClE;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB,
|
|
1
|
+
{"version":3,"file":"TeachMeWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.tsx"],"names":[],"mappings":";AA4LA,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC;CAClE;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB,gCA0GjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/AuditLog/AuditLog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,yCAAyC,CAAC;AA6DjD,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/AuditLog/AuditLog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,yCAAyC,CAAC;AA6DjD,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA6RrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|