@e-llm-studio/instant-learning 1.3.0-alpha.52 → 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/cjs/features/LearningManagement/components/CreateRuleSetLegacyModal.js +1 -1
- package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +1 -1
- package/dist/cjs/features/LearningManagement/queries/useLMSConfigQuery.js +1 -1
- package/dist/cjs/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.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/features/LearningManagement/components/CreateRuleSetLegacyModal.js +1 -1
- package/dist/features/LearningManagement/components/InstantLearningModal.js +1 -1
- package/dist/features/LearningManagement/queries/useLMSConfigQuery.js +1 -1
- package/dist/plugins/ValueTypes/Guidelines/GuidelinesTeachMeRenderer.js +1 -1
- package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts +0 -17
- 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/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts.map +1 -1
- package/dist/types/src/features/LearningManagement/queries/useLMSConfigQuery.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"),r=require("@tanstack/react-query"),t=require("../store/useAuthStore.js"),n=require("../store/useEnvStore.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("@tanstack/react-query"),t=require("../store/useAuthStore.js"),n=require("../store/useEnvStore.js"),o=require("../apis/scopeApis.js"),i=require("../store/useLMSConfigStore.js"),u=require("../store/useLearningTemplateStore.js");exports.useLMSConfigQuery=function(s,a,l){var c=this;void 0===l&&(l=!0);var f=t.default(function(e){var r,t;return null!==(t=null===(r=e.user)||void 0===r?void 0:r.accessToken)&&void 0!==t?t:""}),g=n.default(function(e){var r;return null!==(r=e.llmStudioUrl)&&void 0!==r?r:""}),v=i.useLMSConfigStore(function(e){return e.setLMSConfig}),d=i.useTeachMeConfigStore(function(e){return e.setTeachMeConfig}),C=u.useLearningTemplateStore(function(e){return e.setTemplateData});return r.useQuery({queryKey:["lms-config",s],queryFn:function(){return e.__awaiter(c,void 0,void 0,function(){var r,t,n,i;return e.__generator(this,function(e){switch(e.label){case 0:return[4,o.fetchLMSConfig(g,s,f)];case 1:return r=e.sent(),t=r.lmsConfig,n=r.teachMeConfig,i=r.template,console.log("Fetched LMS Config:",{lmsConfig:t,teachMeConfig:n,template:i}),t&&v(t),n&&d(n),i&&C(s,i),[2,{lmsConfig:t,teachMeConfig:n,template:i}]}})})},enabled:l&&!!s&&!!f&&!!g&&!a,staleTime:6e5})};
|
|
2
2
|
//# sourceMappingURL=useLMSConfigQuery.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react");require("../../../features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("../../../features/IL-OTJ/_components/InputDataReasoningCard.js"),require("../../../features/IL-OTJ/_components/TooltipComponent.js");var a=require("../../../features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");require("../../../features/IL-OTJ/store/CitationsContext.js"),require("@mui/material"),require("uuid"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw"),require("axios"),require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("../../../features/IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../../features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../../features/IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("@viswa-test/test-citation"),require("../../../features/LearningManagement/store/useLearningTemplateStore.js"),require("primereact/toast"),require("../../../features/LearningManagement/apis/scopeApis.js"),require("../../../features/LearningManagement/store/usePermissionsStore.js"),require("../../../features/LearningManagement/store/useLMSConfigStore.js"),require("../../../features/LearningManagement/components/ToolTip.js"),require("../../../features/LearningManagement/store/useAuthStore.js"),require("@mui/icons-material/Check"),require("@mui/icons-material/CloseRounded"),require("@tanstack/react-query"),require("../../../features/LearningManagement/store/useEnvStore.js"),require("date-fns"),require("framer-motion"),require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react");require("../../../features/IL-OTJ/_components/atoms/Textarea/Textarea.js"),require("../../../features/IL-OTJ/_components/InputDataReasoningCard.js"),require("../../../features/IL-OTJ/_components/TooltipComponent.js");var a=require("../../../features/IL-OTJ/_components/templates/TemplatesMap/templatesMap.js");require("../../../features/IL-OTJ/store/CitationsContext.js"),require("@mui/material"),require("uuid"),require("@mui/material/Tooltip"),require("react-markdown"),require("rehype-raw"),require("axios"),require("@e-llm-studio/streaming-response"),require("@e-llm-studio/watch-me-work"),require("../../../features/IL-OTJ/_components/ChatComponents/ChatHeader.js"),require("remark-gfm"),require("../../../features/IL-OTJ/_components/MarkdownComponents/MarkdownElements.js"),require("../../../features/IL-OTJ/_components/CitationLink.js"),require("@e-llm-studio/citation"),require("@viswa-test/test-citation"),require("../../../features/LearningManagement/store/useLearningTemplateStore.js"),require("primereact/toast"),require("../../../features/LearningManagement/apis/scopeApis.js"),require("../../../features/LearningManagement/store/usePermissionsStore.js"),require("../../../features/LearningManagement/store/useLMSConfigStore.js"),require("../../../features/LearningManagement/components/ToolTip.js"),require("../../../features/LearningManagement/store/useAuthStore.js"),require("@mui/icons-material/Check"),require("@mui/icons-material/CloseRounded"),require("@tanstack/react-query"),require("../../../features/LearningManagement/store/useEnvStore.js"),require("date-fns"),require("framer-motion"),require("../../../features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js"),require("../../../features/LearningManagement/store/useConfigStore.js"),require("appsec-ui"),require("@radix-ui/react-tooltip"),require("../../../features/LearningManagement/components/StationOnboarding/InputField.js"),require("../../../features/LearningManagement/config.js"),require("../../../features/LearningManagement/store/useAppSecRolesStore.js"),require("@e-llm-studio/audit-log"),require("@e-llm-studio/audit-log/dist/styles.css"),require("../../../features/LearningManagement/AuditLog/ChangeLogDiff.js"),require("react-router-dom");var i=require("../../../features/IL-OTJ/_components/AccordianSection.js"),o=require("../../../features/IL-OTJ/ILOTJ.js"),s={order_rules:{enabled:!1,global_min_separation_seconds:0},advertiser_rules:{enabled:!1,global_min_separation_seconds:0},inventory_rules:{respect_inventory_code:!1},break_code_rules:{respect_break_code:!1},is_default_enabled:!1},u=[{label:"Global Scope",value:"global"},{label:"Genre Scope",value:"genre"},{label:"Custom Scope",value:"custom"}],l=["Tier 1"];exports.default=function(c){c.baseURL;var d=t.useState(!0),p=d[0],_=d[1],m=t.useState(""),g=m[0],f=m[1],b=t.useState(""),y=b[0],h=b[1],q=t.useState({station:"",tiers:["Tier 1"]}),T=q[0],v=q[1],L=t.useState([]),k=L[0],j=L[1],C=t.useState([]),S=C[0],w=C[1],A=t.useState(s),x=A[0],I=A[1],M=t.useCallback(function(r,t){v(function(n){var a;return e.__assign(e.__assign({},n),((a={})[r]=t,a))})},[]),O=t.useCallback(function(r,t){I(function(n){var a=e.__assign({},n);switch(r){case"order_rules":case"advertiser_rules":a[r]="boolean"==typeof t?e.__assign(e.__assign({},n[r]),{enabled:t}):{enabled:t.enabled,global_min_separation_seconds:t.global_min_separation_seconds};break;case"inventory_rules":a.inventory_rules={respect_inventory_code:"boolean"==typeof t?t:t.respect_inventory_code};break;case"break_code_rules":a.break_code_rules={respect_break_code:"boolean"==typeof t?t:t.respect_break_code};break;case"is_default_enabled":a.is_default_enabled="boolean"==typeof t?t:!!t}return a})},[]),G=function(r){r(function(r){return e.__spreadArray(e.__spreadArray([],r,!0),[{id:Date.now(),text:"",reasoning:""}],!1)})},J=function(e,r){e(function(e){return e.filter(function(e){return e.id!==r})})},N=function(r,t,n){r(function(r){return r.map(function(r){return String(r.id)===String(t)?e.__assign(e.__assign({},r),{text:n}):r})})},W=[e.__assign({key:"order_rules",label:"Order"},x.order_rules),e.__assign({key:"advertiser_rules",label:"Advertiser"},x.advertiser_rules)],D=[{key:"inventory_rules",label:"Inventory code",enabled:x.inventory_rules.respect_inventory_code},{key:"break_code_rules",label:"Break Code",enabled:x.break_code_rules.respect_break_code},{key:"is_default_enabled",label:"Default Variant",enabled:x.is_default_enabled}],R={"Add Guideline":"I would want to add a separation rule","Search Guideline":"I would want to set a max priority rule","Type your query":"I would want to add a break code matching rule"},B="<p><span>Hi! 👋 I'm your Instant Learning Concierge.</span>\n <span>How would you like to get started? You can select an option below or describe the Guideline you’d like to create.</span>\n ".concat(["Add Guideline","Search Guideline","Type your query"].map(function(e){return'<button class="clickable-button" data-value="'.concat(R[e],'">').concat(e,"</button>")}).join(""),"</p>");return r.jsx(o.default,{open:p,closeFunction:function(){return _(!1)},chatAssistantName:"defaultAssistant",organizationName:"techolution",baseUrl:"https://devllmstudio.creativeworkspace.ai",baseWebsocketUrl:"wss://devllmstudio.creativeworkspace.ai/graphql",ThinkingBulbIconComponent:r.jsx(n.Lightbulb,{}),customSections:r.jsx(r.Fragment,{}),isUseNormalChat:!0,chatTitle:"Create New Guideline",formTitle:"Guideline Details",initialChatMessage:B,template:a.TemplateList.BaseTemplate,templateProps:{state:{title:g,description:y,scopeData:T,whenToApplyConditions:k,whenNotToApplyConditions:S,configData:x,citations:[],citation:{}},handlers:{onTitleChange:function(e){var r,t;return f(null!==(t=null===(r=null==e?void 0:e.target)||void 0===r?void 0:r.value)&&void 0!==t?t:e)},onDescriptionChange:function(e){var r,t;return h(null!==(t=null===(r=null==e?void 0:e.target)||void 0===r?void 0:r.value)&&void 0!==t?t:e)},onAddWhenToApply:function(){return G(j)},onRemoveWhenToApply:function(e){return J(j,e)},onEditWhenToApply:function(e,r){return N(j,e,r)},onAddWhenNotToApply:function(){return G(w)},onRemoveWhenNotToApply:function(e){return J(w,e)},onEditWhenNotToApply:function(e,r){return N(w,e,r)},onScopeChange:M,onConfigChange:O},uiState:{showScope:!1,showConfiguration:!1,titleLabel:"Guideline Name",scopeLabel:"Define Scope",tierLabel:"Select Tier",descriptionLabel:"Guideline Description",whenToApplyLabel:"When to apply this Guideline (When to Apply)",whenNotToApplyLabel:"When not to apply this Guideline (When NOT to Apply)",configLabel:"Advanced Settings",stationOptions:u,tierOptions:l,separationItems:W,toggles:D},customNodes:{afterTitle:r.jsx(i.default,e.__assign({title:{type:"other",label:"Guideline"}},{children:r.jsx("p",e.__assign({style:{padding:"12px",fontSize:"14px",color:"#64748b"}},{children:"HealthCare"}))})),top:r.jsxs("div",e.__assign({style:{marginBottom:"12px",padding:"8px",backgroundColor:"#f0f4ff",borderRadius:"4px"}},{children:[r.jsx("strong",{children:"Guideline Template:"})," This is an ILOTJ TeachMe customized for Guideline Value Type"]}))}}})};
|
|
2
2
|
//# sourceMappingURL=GuidelinesTeachMeRenderer.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,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as r,__generator as o,__spreadArray as i}from"tslib";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import{v4 as p}from"uuid";import{IL_CONFIG_CONSTANTS as d}from"../config.js";import s from"../store/useAuthStore.js";import c from"../RuleContent/AddScopeApprovalSearchComponent.js";import{useAppSecRolesStore as u}from"../store/useAppSecRolesStore.js";import f from"../store/useEnvStore.js";import h from"./ScopeSkeletonLoader.js";var x=function(x){var m=x.isOpen,g=x.onClose,v=x.onSubmit,b=x.hasGlobalRuleSet,y=void 0!==b&&b;x.canCreateGlobal;var S=x.globalScopeId,C=void 0===S?null:S,k=l("");k[0];var E=k[1],w=l(""),B=w[0],
|
|
1
|
+
import{__assign as e,__awaiter as r,__generator as o,__spreadArray as i}from"tslib";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import{v4 as p}from"uuid";import{IL_CONFIG_CONSTANTS as d}from"../config.js";import s from"../store/useAuthStore.js";import c from"../RuleContent/AddScopeApprovalSearchComponent.js";import{useAppSecRolesStore as u}from"../store/useAppSecRolesStore.js";import f from"../store/useEnvStore.js";import h from"./ScopeSkeletonLoader.js";var x=function(x){var m=x.isOpen,g=x.onClose,v=x.onSubmit,b=x.hasGlobalRuleSet,y=void 0!==b&&b;x.canCreateGlobal;var S=x.globalScopeId,C=void 0===S?null:S,k=l("");k[0];var E=k[1],w=l(""),B=w[0],D=w[1],_=l(""),R=_[0],z=_[1],I=l(!1),q=I[0],A=I[1],j=l({}),F=j[0],G=j[1],L=l("approval_required"),W=L[0],N=L[1],T=l([]),O=T[0],P=T[1],H=l([]),M=H[0],K=H[1],U=l(""),Y=U[0],J=U[1],Q=s().user,V=u(function(e){return e.roles}),X=f(function(e){return e.rbacConfig});if(a(function(){m&&(E(""),D(""),z(""),G({}),N("approval_required"),P([]),K([]),J(""))},[m]),!m)return null;var Z={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.3)"},modal:{position:"relative",width:"600px",borderRadius:"12px",backgroundColor:"#ffffff",padding:"24px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",maxHeight:"90vh",overflowY:"auto"},header:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"24px"},title:{margin:0,fontSize:"18px",fontWeight:500,color:"#19213D"},subtitle:{marginTop:"4px",fontSize:"14px",fontWeight:400,color:"#666F8D"},closeButton:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#9CA3AF"},formGroup:{display:"flex",flexDirection:"column",marginBottom:"20px",gap:"6px"},label:{fontSize:"14px",fontWeight:500,color:"#19213D"},asterisk:{color:"#8F2C23",marginRight:"4px",fontSize:"16px",fontWeight:600},input:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid #E2E8F0",outline:"none",fontSize:"14px"},inputError:{border:"1px solid #8F2C23"},errorText:{margin:0,marginTop:"4px",fontSize:"12px",color:"#8F2C23"},textarea:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid #E2E8F0",outline:"none",fontSize:"14px",minHeight:"100px",maxHeight:"200px",overflowY:"auto",resize:"vertical"},footer:{display:"flex",justifyContent:"flex-end",gap:"12px",marginTop:"32px"},cancelBtn:{padding:"8px 16px",borderRadius:"6px",border:"1px solid #E2E8F0",backgroundColor:"transparent",color:"#64748B",fontSize:"14px",fontWeight:500,cursor:"pointer"},submitBtn:{padding:"8px 16px",borderRadius:"6px",border:"none",backgroundColor:"#2563EB",color:"#ffffff",fontSize:"14px",fontWeight:500,cursor:"pointer"},disabledBtn:{opacity:.5,cursor:"not-allowed"}};return q?t(h,{isLoading:q}):t("div",e({style:Z.overlay},{children:n("div",e({style:Z.modal},{children:[n("div",e({style:Z.header},{children:[n("div",{children:[t("h2",e({style:Z.title},{children:"Create Scope"})),t("p",e({style:Z.subtitle},{children:"Create a scope to group and manage rules."}))]}),t("button",e({onClick:g,style:Z.closeButton},{children:"✕"}))]})),n("div",{children:[n("div",e({style:Z.formGroup},{children:[n("label",e({style:Z.label},{children:[t("span",e({style:Z.asterisk},{children:"*"})),"Scope Name"]})),t("input",{type:"text",value:B,onChange:function(r){var o=r.target.value;if(o.length>50)return D(o.slice(0,50)),void G(function(r){return e(e({},r),{name:"Scope Name must be 50 characters or fewer"})});D(o),F.name&&G(function(r){return e(e({},r),{name:void 0})})},placeholder:"e.g. Global Learnings",style:e(e({},Z.input),F.name?Z.inputError:{})}),F.name&&t("p",e({style:Z.errorText},{children:F.name}))]})),n("div",e({style:Z.formGroup},{children:[n("label",e({style:Z.label},{children:[t("span",e({style:Z.asterisk},{children:"*"})),"Description"]})),t("input",{type:"text",value:R,onChange:function(r){var o=r.target.value;if(o.length>200)return z(o.slice(0,200)),void G(function(r){return e(e({},r),{description:"Description must be 200 characters or fewer"})});z(o),F.description&&G(function(r){return e(e({},r),{description:void 0})})},placeholder:"Enter short description for scope",style:e(e({},Z.input),F.description?Z.inputError:{})}),F.description&&t("p",e({style:Z.errorText},{children:F.description}))]})),n("div",e({style:e(e({},Z.formGroup),{gap:"12px"})},{children:[t("label",e({style:Z.label},{children:"Approval Settings"})),n("div",e({role:"radio","aria-checked":"approval_required"===W,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},onClick:function(){return N("approval_required")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||N("approval_required")}},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t("div",e({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("approval_required"===W?"#2563EB":"#CBD5E1")}},{children:"approval_required"===W&&t("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),t("span",e({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Approval Required Before Publishing"}))]})),t("p",e({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings require approval before publishing."}))]})),"approval_required"===W&&t(c,{selectedApprovers:O,selectedGroupOfApprovers:M,onApproversChange:P,onGroupsChange:K}),Y&&t("p",e({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#8F2C23"}},{children:Y})),n("div",e({role:"radio","aria-checked":"publish_without"===W,tabIndex:0,style:{cursor:"pointer",display:"flex",flexDirection:"column",gap:"4px"},onClick:function(){N("publish_without"),J("")},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(N("publish_without"),J(""))}},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[t("div",e({style:{display:"flex",height:"16px",width:"16px",flexShrink:0,alignItems:"center",justifyContent:"center",borderRadius:"50%",border:"2px solid ".concat("publish_without"===W?"#2563EB":"#CBD5E1")}},{children:"publish_without"===W&&t("div",{style:{height:"8px",width:"8px",borderRadius:"50%",backgroundColor:"#2563EB"}})})),t("span",e({style:{fontSize:"14px",fontWeight:500,color:"#19213D"}},{children:"Publish Without Approval"}))]})),t("p",e({style:{margin:0,marginLeft:"24px",fontSize:"12px",color:"#666F8D"}},{children:"Learnings can be published directly."}))]}))]}))]}),n("div",e({style:Z.footer},{children:[t("button",e({onClick:g,disabled:q,style:e(e({},Z.cancelBtn),q?Z.disabledBtn:{})},{children:"Cancel"})),t("button",e({onClick:function(){return r(void 0,void 0,void 0,function(){var e,r,t,n,l,a,s,c,u;return o(this,function(o){switch(o.label){case 0:if(f={},h=!0,B.trim()||(f.name="Scope Name is required",h=!1),R.trim()||(f.description="Description is required",h=!1),G(f),!h)return[2];J(""),A(!0),e=y?"genreRuleSet":"globalRuleSet",r="approval_required"===W,t=O.length>0||M.length>0,console.log("topicData",e),n={topic:e,customScopeGroupName:d.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:R,parentScopeId:y?C:null,customScopeName:B,customScopeId:p(),createByName:null==Q?void 0:Q.firstname,createdBy:null==Q?void 0:Q.email,approvalRequired:r,appsecData:{application:null==X?void 0:X.applicationId,module:null==X?void 0:X.moduleId,roles:i(i([],r&&t?[{users:O.map(function(e){return e.email}),groups:M.map(function(e){return e._id}),role:null!==(s=null===(a=V.find(function(e){return"Learning Manager"===e.name}))||void 0===a?void 0:a._id)&&void 0!==s?s:""}]:[],!0),[{users:[null==Q?void 0:Q.email],groups:[],role:null!==(u=null===(c=V.find(function(e){return"Instant Learning Admin"===e.name}))||void 0===c?void 0:c._id)&&void 0!==u?u:""}],!1)}},o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,v(n)];case 2:return o.sent(),g(),[3,5];case 3:return l=o.sent(),console.error("Error in submission",l),[3,5];case 4:return A(!1),[7];case 5:return[2]}var f,h})})},disabled:q,style:e(e({},Z.submitBtn),q?Z.disabledBtn:{})},{children:q?"Creating...":"Create Scope"}))]}))]}))}))};export{x as default};
|
|
2
2
|
//# sourceMappingURL=CreateRuleSetLegacyModal.js.map
|