aiware-js 1.0.0-master.1088 → 1.0.0-master.1089

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/js-core.esm106.js CHANGED
@@ -1 +1 @@
1
- import{an as selectSelectedDagTemplate,ao as selectDagTemplatesLoadingStatus,a as selectIsEditMode,b as selectUpdateJobErrors,D as selectActiveEngine,ap as selectAllDagTemplates,c as actions$8,aq as actions$4,S as SHARED_TEXT,P as PanelControls$1,E as ENextButtonType,ar as selectDagTemplatesHasMore,as as __rest}from"./js-core.esm80.js";import{Z as useSelector,dH as selectIsFullscreenEnabled,r as react,j as jsxRuntime,ar as mountPanel,aq as unmountPanel,fk as img$H}from"./js-core.esm.js";import{m as makeStyles,T as Typography,h as Button,al as ErrorState}from"./js-core.esm5.js";import{f as Skeleton,a7 as AutoSizer,a8 as InfiniteLoader,a1 as VariableSizeList,d as Tooltip,I as IconButton,g as Chip}from"./js-core.esm6.js";import"./js-core.esm50.js";import"./js-core.esm75.js";import"./js-core.esm51.js";import{E as EditOutlined}from"./js-core.esm53.js";import{u as useDispatch}from"./js-core.esm7.js";import"./js-core.esm33.js";import"./js-core.esm56.js";import"./js-core.esm29.js";import"./js-core.esm17.js";import"./js-core.esm2.js";import"./js-core.esm4.js";import"./js-core.esm3.js";import"./js-core.esm81.js";import"./js-core.esm55.js";import"./js-core.esm45.js";import"./js-core.esm9.js";import"./js-core.esm52.js";import"./js-core.esm59.js";import"./js-core.esm26.js";import"./js-core.esm25.js";import"./js-core.esm54.js";import"./js-core.esm57.js";import"./js-core.esm40.js";import"./js-core.esm46.js";import"./js-core.esm47.js";import"./js-core.esm43.js";import"./js-core.esm58.js";const useStyles$4=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",width:"100%",height:"100%",background:"#fff",borderRadius:"6px",overflow:"hidden",flexWrap:"wrap"},image:{display:"flex",textAlign:"center",width:"235px",height:"235px",marginBottom:e.spacing(2)},message:{userSelect:"none",paddingBottom:e.spacing(2)}})),DagTemplatesLoadingState=()=>{var e=useStyles$4()["classes"];return jsxRuntime.exports.jsx("div",Object.assign({className:e.container},{children:new Array(15).fill(null).map((e,t)=>jsxRuntime.exports.jsx(DagTemplateLoadingRow,{},t))}))},DagTemplateLoadingRow=()=>{var e=makeStyles()(e=>({container:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",height:"50px",background:"#fff",borderBottom:"1px solid #f7f7f7",borderRadius:"6px",padding:"0px 15px"},title:{width:"25%",height:"70%"},button:{width:"12%",height:"80%"}}))()["classes"];return jsxRuntime.exports.jsxs("div",Object.assign({className:e.container},{children:[jsxRuntime.exports.jsx(Skeleton,{className:e.title}),jsxRuntime.exports.jsx(Skeleton,{className:e.button})]}))},useStyles$3=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",paddingTop:e.spacing(18),width:"100%",height:"100%",background:"#fff",borderRadius:"6px"},image:{display:"flex",textAlign:"center",width:"235px",height:"235px",marginBottom:e.spacing(2)},message:{userSelect:"none",paddingBottom:e.spacing(2)}})),DagTemplatesEmptyState=()=>{var e=useStyles$3()["classes"];return jsxRuntime.exports.jsxs("div",Object.assign({className:e.container},{children:[jsxRuntime.exports.jsx("img",{"data-testid":"pc-dag-templates-empty-image",alt:"empty-asset",className:e.image,src:img$H}),jsxRuntime.exports.jsx(Typography,Object.assign({"data-testid":"pc-dag-templates-empty-message",className:e.message,variant:"h3",color:"textPrimary"},{children:SHARED_TEXT.processing.emptyState()}))]}))},OverflowTooltip=e=>{var t=e["children"],e=__rest(e,["children"]);const[s,a]=react.exports.useState(!1);return jsxRuntime.exports.jsx(Tooltip,Object.assign({onMouseEnter:({currentTarget:e})=>{e.scrollWidth>e.clientWidth&&a(!0)},onMouseLeave:()=>a(!1),disableHoverListener:!s},e,{children:jsxRuntime.exports.jsx("div",Object.assign({style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:t}))}))},useStyles$2=makeStyles()(e=>({container:{display:"flex",minHeight:"50px",justifyContent:"space-between",background:"#fff",alignItems:"center",padding:"9px 15px",borderBottom:"1px solid #f7f7f7","&:hover":{background:"rgba(228, 240, 252, 0.4)",cursor:"pointer"}},isSelected:{background:"rgba(228, 240, 252, 0.8)!important","&:hover":{cursor:"auto!important"}},flex:{display:"flex",alignItems:"center",gap:"15px",width:"70%"}})),DagTemplateRow=({dagTemplate:e,onClick:t,isSelected:s})=>{var a=useStyles$2()["classes"];const i=useDispatch(),n=useSelector(selectIsFullscreenEnabled),{name:o,id:r,description:l}=e;var c=a.container+" "+(s?a.isSelected:"");let p=!0,m=SHARED_TEXT.processing.tooltips.edit();try{JSON.parse(e.dag.template)}catch(e){p=!1,m=SHARED_TEXT.processing.tooltips.notSupported()}return jsxRuntime.exports.jsxs("div",Object.assign({onClick:()=>{s||t(e)},className:c,"data-testid":s?"pc-dag-template-item-row":"pc-dag-template-item-row-selected","data-meta":"pc-dag-template-item-row-"+o},{children:[jsxRuntime.exports.jsx("div",Object.assign({className:a.flex},{children:jsxRuntime.exports.jsxs("div",Object.assign({style:{width:"100%"}},{children:[jsxRuntime.exports.jsx(OverflowTooltip,Object.assign({title:o},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"subtitle2",sx:{cursor:"unset"}},{children:o}))})),jsxRuntime.exports.jsx(OverflowTooltip,Object.assign({title:l},{children:jsxRuntime.exports.jsxs(Typography,Object.assign({variant:"caption"},{children:[l,!l&&"Template"]}))}))]}))})),!s&&!(null!=e&&e.name.includes(" - Ingest Only"))&&jsxRuntime.exports.jsx(Tooltip,Object.assign({title:m},{children:jsxRuntime.exports.jsx("span",{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),i(mountPanel({panelId:"PROCESSING_CENTER_DAG_BUILDER",microFrontend:{name:"PROCESSING_CENTER_DAG_BUILDER",config:{dagTemplateId:r,onSave:()=>{i(unmountPanel("PROCESSING_CENTER_DAG_BUILDER")),i(actions$4.resetList()),i(actions$4.fetchDagTemplatesStart())}}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:n?0:55,marginStart:n?0:80,size:"xlarge"}}))},disabled:!p},{children:jsxRuntime.exports.jsx(EditOutlined,{})}))})})),!s&&(null==e?void 0:e.name.includes(" - Ingest Only"))&&jsxRuntime.exports.jsx(Tooltip,Object.assign({title:m},{children:jsxRuntime.exports.jsx(Chip,{label:"Ingest Only",size:"small",color:"info",variant:"outlined"})})),s&&jsxRuntime.exports.jsx(Button,Object.assign({sx:{backgroundColor:"#fff"},onClick:()=>t(e),variant:"outlined","data-testid":"pc-dag-templates-select-template-button"},{children:SHARED_TEXT.processing.selectButton.cancelSelection()}))]}))},useStyles$1=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",gap:"25px",height:"100%"},templateListContainer:{backgroundColor:"#F6F7FA",borderRadius:"7px",padding:"2px",boxSizing:"border-box",flexGrow:1},templateList:{height:"100%"}})),DagTemplateList=({onSelectTemplate:a})=>{var e=useStyles$1()["classes"];const t=useDispatch(),i=useSelector(selectAllDagTemplates),n=useSelector(selectSelectedDagTemplate),s=useSelector(selectDagTemplatesHasMore),o=useSelector(selectDagTemplatesLoadingStatus),r=e=>!s||e<i.length,l=s?i.length+1:i.length,c=({index:e,style:t})=>{var s;return r(e)?(s=i[e],jsxRuntime.exports.jsx("div",Object.assign({"data-testid":"dag-template-infinite-loader-row",style:Object.assign({},t)},{children:jsxRuntime.exports.jsx(DagTemplateRow,{isSelected:n===s,onClick:a,dagTemplate:s},e)}),e)):jsxRuntime.exports.jsx("div",Object.assign({"data-testid":"dag-template-row-loader",style:Object.assign(Object.assign({},t),{top:0})},{children:jsxRuntime.exports.jsx(DagTemplateLoadingRow,{})}),e)};return jsxRuntime.exports.jsxs("div",Object.assign({className:e.templateList},{children:[0===i.length&&jsxRuntime.exports.jsx(DagTemplatesEmptyState,{}),jsxRuntime.exports.jsx(AutoSizer,{children:({height:s,width:a})=>jsxRuntime.exports.jsx(InfiniteLoader,Object.assign({isItemLoaded:r,itemCount:l,loadMoreItems:()=>{"success"===o&&t(actions$4.fetchDagTemplatesStart())}},{children:({onItemsRendered:e,ref:t})=>jsxRuntime.exports.jsx("div",Object.assign({"data-testid":"ingestion-dag-templates-list-wrapper"},{children:jsxRuntime.exports.jsx(VariableSizeList,Object.assign({height:s,itemCount:l,itemSize:()=>60,onItemsRendered:e,ref:t,width:a},{children:c}),"dag-template-list")}))}))})]}))},useStyles=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",gap:"25px",height:"100%"},templateListContainer:{backgroundColor:"#F6F7FA",borderRadius:"7px",padding:"2px",boxSizing:"border-box",flexGrow:1},templateList:{maxHeight:"100%",overflowY:"auto"},flex:{display:"flex",justifyContent:"space-between",padding:"10px 0px"},title:{marginBottom:"4px"},subtitle:{marginBottom:"8px"}})),ProcessingStep=()=>{var e=useStyles()["classes"];const t=useDispatch(),s=useSelector(selectSelectedDagTemplate),a=useSelector(selectDagTemplatesLoadingStatus);var i="pending"===a,n="failure"===a;const o=useSelector(selectIsFullscreenEnabled),r=useSelector(selectIsEditMode);var l=useSelector(selectUpdateJobErrors);const c=useSelector(selectActiveEngine);var p=0===useSelector(selectAllDagTemplates).length&&i;react.exports.useEffect(()=>{var e;r&&(e=!s,t(actions$8.setUpdateJobErrors({add:e,tabIndex:4})))},[r,s]);return react.exports.useEffect(()=>{"idle"===a&&t(actions$4.fetchDagTemplatesStart())},[]),jsxRuntime.exports.jsxs("div",Object.assign({className:e.container},{children:[jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h5",className:e.title},{children:SHARED_TEXT.processing.title()})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption",className:e.subtitle},{children:SHARED_TEXT.processing.subtitle()}))]}),jsxRuntime.exports.jsxs("div",Object.assign({className:e.flex},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"subtitle2"},{children:SHARED_TEXT.processing.chooseTemplate()})),jsxRuntime.exports.jsx(Button,Object.assign({onClick:()=>{t(mountPanel({panelId:"PROCESSING_CENTER_DAG_BUILDER",microFrontend:{name:"PROCESSING_CENTER_DAG_BUILDER",config:{ingestionAdapterId:null===c||void 0===c?void 0:c.id,onSave:()=>{t(unmountPanel("PROCESSING_CENTER_DAG_BUILDER")),t(actions$4.resetList()),t(actions$4.fetchDagTemplatesStart())}}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:o?0:55,marginStart:o?0:80,size:"xlarge",parentPanelId:"PROCESSING_CENTER_INGESTION",dimmedStatus:"dimParent"}}))},"data-testid":"pc-dag-templates-create-template-button",variant:"contained"},{children:SHARED_TEXT.processing.createNewTemplate()}))]})),!i&&n&&jsxRuntime.exports.jsx(ErrorState,{onRetry:()=>{t(actions$4.fetchDagTemplatesStart())},errorMessage:jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:SHARED_TEXT.processing.errorState()})}),!n&&jsxRuntime.exports.jsxs("div",Object.assign({className:e.templateListContainer},{children:[p&&jsxRuntime.exports.jsx(DagTemplatesLoadingState,{}),!p&&jsxRuntime.exports.jsx(DagTemplateList,{onSelectTemplate:e=>{e===s?(t(actions$4.clearSelectedDagTemplate()),t(actions$4.clearDagTemplateId())):(t(actions$4.setDagTemplateId(null==e?void 0:e.id)),t(actions$4.setSelectedDagTemplate(e)))}})]})),s||0<l.length?jsxRuntime.exports.jsx(PanelControls$1,{disableNext:!s||0<l.length,disableBack:!1,nextButtonType:r?ENextButtonType.UPDATE_SCHEDULED_JOB:ENextButtonType.NEXT}):jsxRuntime.exports.jsx(PanelControls$1,{disableNext:!1,disableBack:!1,nextButtonType:r?ENextButtonType.UPDATE_SCHEDULED_JOB:ENextButtonType.CUSTOM_NEXT,onClickNext:()=>{t(actions$4.createIngestOnlyDagTemplateStart())}})]}))};export{ProcessingStep as default};
1
+ import{an as selectSelectedDagTemplate,ao as selectDagTemplateId,ap as selectDagTemplatesLoadingStatus,a as selectIsEditMode,b as selectUpdateJobErrors,D as selectActiveEngine,aq as selectAllDagTemplates,c as actions$8,ar as actions$4,S as SHARED_TEXT,P as PanelControls$1,E as ENextButtonType,as as selectDagTemplatesHasMore,at as __rest}from"./js-core.esm80.js";import{Z as useSelector,dH as selectIsFullscreenEnabled,r as react,j as jsxRuntime,ar as mountPanel,aq as unmountPanel,fk as img$H}from"./js-core.esm.js";import{m as makeStyles,T as Typography,h as Button,al as ErrorState}from"./js-core.esm5.js";import{f as Skeleton,a7 as AutoSizer,a8 as InfiniteLoader,a1 as VariableSizeList,d as Tooltip,I as IconButton,g as Chip}from"./js-core.esm6.js";import"./js-core.esm50.js";import"./js-core.esm75.js";import"./js-core.esm51.js";import{E as EditOutlined}from"./js-core.esm53.js";import{u as useDispatch}from"./js-core.esm7.js";import"./js-core.esm33.js";import"./js-core.esm56.js";import"./js-core.esm29.js";import"./js-core.esm17.js";import"./js-core.esm2.js";import"./js-core.esm4.js";import"./js-core.esm3.js";import"./js-core.esm81.js";import"./js-core.esm55.js";import"./js-core.esm45.js";import"./js-core.esm9.js";import"./js-core.esm52.js";import"./js-core.esm59.js";import"./js-core.esm26.js";import"./js-core.esm25.js";import"./js-core.esm54.js";import"./js-core.esm57.js";import"./js-core.esm40.js";import"./js-core.esm46.js";import"./js-core.esm47.js";import"./js-core.esm43.js";import"./js-core.esm58.js";const useStyles$4=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",width:"100%",height:"100%",background:"#fff",borderRadius:"6px",overflow:"hidden",flexWrap:"wrap"},image:{display:"flex",textAlign:"center",width:"235px",height:"235px",marginBottom:e.spacing(2)},message:{userSelect:"none",paddingBottom:e.spacing(2)}})),DagTemplatesLoadingState=()=>{var e=useStyles$4()["classes"];return jsxRuntime.exports.jsx("div",Object.assign({className:e.container},{children:new Array(15).fill(null).map((e,t)=>jsxRuntime.exports.jsx(DagTemplateLoadingRow,{},t))}))},DagTemplateLoadingRow=()=>{var e=makeStyles()(e=>({container:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",height:"50px",background:"#fff",borderBottom:"1px solid #f7f7f7",borderRadius:"6px",padding:"0px 15px"},title:{width:"25%",height:"70%"},button:{width:"12%",height:"80%"}}))()["classes"];return jsxRuntime.exports.jsxs("div",Object.assign({className:e.container},{children:[jsxRuntime.exports.jsx(Skeleton,{className:e.title}),jsxRuntime.exports.jsx(Skeleton,{className:e.button})]}))},useStyles$3=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",paddingTop:e.spacing(18),width:"100%",height:"100%",background:"#fff",borderRadius:"6px"},image:{display:"flex",textAlign:"center",width:"235px",height:"235px",marginBottom:e.spacing(2)},message:{userSelect:"none",paddingBottom:e.spacing(2)}})),DagTemplatesEmptyState=()=>{var e=useStyles$3()["classes"];return jsxRuntime.exports.jsxs("div",Object.assign({className:e.container},{children:[jsxRuntime.exports.jsx("img",{"data-testid":"pc-dag-templates-empty-image",alt:"empty-asset",className:e.image,src:img$H}),jsxRuntime.exports.jsx(Typography,Object.assign({"data-testid":"pc-dag-templates-empty-message",className:e.message,variant:"h3",color:"textPrimary"},{children:SHARED_TEXT.processing.emptyState()}))]}))},OverflowTooltip=e=>{var t=e["children"],e=__rest(e,["children"]);const[s,a]=react.exports.useState(!1);return jsxRuntime.exports.jsx(Tooltip,Object.assign({onMouseEnter:({currentTarget:e})=>{e.scrollWidth>e.clientWidth&&a(!0)},onMouseLeave:()=>a(!1),disableHoverListener:!s},e,{children:jsxRuntime.exports.jsx("div",Object.assign({style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},{children:t}))}))},useStyles$2=makeStyles()(e=>({container:{display:"flex",minHeight:"50px",justifyContent:"space-between",background:"#fff",alignItems:"center",padding:"9px 15px",borderBottom:"1px solid #f7f7f7","&:hover":{background:"rgba(228, 240, 252, 0.4)",cursor:"pointer"}},isSelected:{background:"rgba(228, 240, 252, 0.8)!important","&:hover":{cursor:"auto!important"}},flex:{display:"flex",alignItems:"center",gap:"15px",width:"70%"}})),DagTemplateRow=({dagTemplate:e,onClick:t,isSelected:s})=>{var a=useStyles$2()["classes"];const i=useDispatch(),n=useSelector(selectIsFullscreenEnabled),{name:o,id:r,description:l}=e;var c=a.container+" "+(s?a.isSelected:"");let p=!0,m=SHARED_TEXT.processing.tooltips.edit();try{JSON.parse(e.dag.template)}catch(e){p=!1,m=SHARED_TEXT.processing.tooltips.notSupported()}return jsxRuntime.exports.jsxs("div",Object.assign({onClick:()=>{s||t(e)},className:c,"data-testid":s?"pc-dag-template-item-row":"pc-dag-template-item-row-selected","data-meta":"pc-dag-template-item-row-"+o},{children:[jsxRuntime.exports.jsx("div",Object.assign({className:a.flex},{children:jsxRuntime.exports.jsxs("div",Object.assign({style:{width:"100%"}},{children:[jsxRuntime.exports.jsx(OverflowTooltip,Object.assign({title:o},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"subtitle2",sx:{cursor:"unset"}},{children:o}))})),jsxRuntime.exports.jsx(OverflowTooltip,Object.assign({title:l},{children:jsxRuntime.exports.jsxs(Typography,Object.assign({variant:"caption"},{children:[l,!l&&"Template"]}))}))]}))})),!s&&!(null!=e&&e.name.includes(" - Ingest Only"))&&jsxRuntime.exports.jsx(Tooltip,Object.assign({title:m},{children:jsxRuntime.exports.jsx("span",{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),i(mountPanel({panelId:"PROCESSING_CENTER_DAG_BUILDER",microFrontend:{name:"PROCESSING_CENTER_DAG_BUILDER",config:{dagTemplateId:r,onSave:()=>{i(unmountPanel("PROCESSING_CENTER_DAG_BUILDER")),i(actions$4.resetList()),i(actions$4.fetchDagTemplatesStart())}}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:n?0:55,marginStart:n?0:80,size:"xlarge"}}))},disabled:!p},{children:jsxRuntime.exports.jsx(EditOutlined,{})}))})})),!s&&(null==e?void 0:e.name.includes(" - Ingest Only"))&&jsxRuntime.exports.jsx(Tooltip,Object.assign({title:m},{children:jsxRuntime.exports.jsx(Chip,{label:"Ingest Only",size:"small",color:"info",variant:"outlined"})})),s&&jsxRuntime.exports.jsx(Button,Object.assign({sx:{backgroundColor:"#fff"},onClick:()=>t(e),variant:"outlined","data-testid":"pc-dag-templates-select-template-button"},{children:SHARED_TEXT.processing.selectButton.cancelSelection()}))]}))},useStyles$1=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",gap:"25px",height:"100%"},templateListContainer:{backgroundColor:"#F6F7FA",borderRadius:"7px",padding:"2px",boxSizing:"border-box",flexGrow:1},templateList:{height:"100%"}})),DagTemplateList=({onSelectTemplate:a})=>{var e=useStyles$1()["classes"];const t=useDispatch(),i=useSelector(selectAllDagTemplates),n=useSelector(selectSelectedDagTemplate),s=useSelector(selectDagTemplatesHasMore),o=useSelector(selectDagTemplatesLoadingStatus),r=e=>!s||e<i.length,l=s?i.length+1:i.length,c=({index:e,style:t})=>{var s;return r(e)?(s=i[e],jsxRuntime.exports.jsx("div",Object.assign({"data-testid":"dag-template-infinite-loader-row",style:Object.assign({},t)},{children:jsxRuntime.exports.jsx(DagTemplateRow,{isSelected:(null===n||void 0===n?void 0:n.id)===s.id,onClick:a,dagTemplate:s},e)}),e)):jsxRuntime.exports.jsx("div",Object.assign({"data-testid":"dag-template-row-loader",style:Object.assign(Object.assign({},t),{top:0})},{children:jsxRuntime.exports.jsx(DagTemplateLoadingRow,{})}),e)};return jsxRuntime.exports.jsxs("div",Object.assign({className:e.templateList},{children:[0===i.length&&jsxRuntime.exports.jsx(DagTemplatesEmptyState,{}),jsxRuntime.exports.jsx(AutoSizer,{children:({height:s,width:a})=>jsxRuntime.exports.jsx(InfiniteLoader,Object.assign({isItemLoaded:r,itemCount:l,loadMoreItems:()=>{"success"===o&&t(actions$4.fetchDagTemplatesStart())}},{children:({onItemsRendered:e,ref:t})=>jsxRuntime.exports.jsx("div",Object.assign({"data-testid":"ingestion-dag-templates-list-wrapper"},{children:jsxRuntime.exports.jsx(VariableSizeList,Object.assign({height:s,itemCount:l,itemSize:()=>60,onItemsRendered:e,ref:t,width:a},{children:c}),"dag-template-list")}))}))})]}))},useStyles=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",gap:"25px",height:"100%"},templateListContainer:{backgroundColor:"#F6F7FA",borderRadius:"7px",padding:"2px",boxSizing:"border-box",flexGrow:1},templateList:{maxHeight:"100%",overflowY:"auto"},flex:{display:"flex",justifyContent:"space-between",padding:"10px 0px"},title:{marginBottom:"4px"},subtitle:{marginBottom:"8px"}})),ProcessingStep=()=>{var e=useStyles()["classes"];const t=useDispatch(),s=useSelector(selectSelectedDagTemplate),a=useSelector(selectDagTemplateId),i=useSelector(selectDagTemplatesLoadingStatus);var n="pending"===i,o="failure"===i;const r=useSelector(selectIsFullscreenEnabled),l=useSelector(selectIsEditMode);var c=useSelector(selectUpdateJobErrors);const p=useSelector(selectActiveEngine),m=useSelector(selectAllDagTemplates);var d=0===m.length&&n;react.exports.useEffect(()=>{var e;l&&!a?(e=!s,t(actions$8.setUpdateJobErrors({add:e,tabIndex:4}))):l&&a&&(e=m.find(e=>e.id===a))&&e.id!==(null===s||void 0===s?void 0:s.id)&&t(actions$4.setSelectedDagTemplate(e))},[t,l,m,a,s]);return react.exports.useEffect(()=>{"idle"===i&&t(actions$4.fetchDagTemplatesStart())},[]),jsxRuntime.exports.jsxs("div",Object.assign({className:e.container},{children:[jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h5",className:e.title},{children:SHARED_TEXT.processing.title()})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption",className:e.subtitle},{children:SHARED_TEXT.processing.subtitle()}))]}),jsxRuntime.exports.jsxs("div",Object.assign({className:e.flex},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"subtitle2"},{children:SHARED_TEXT.processing.chooseTemplate()})),jsxRuntime.exports.jsx(Button,Object.assign({onClick:()=>{t(mountPanel({panelId:"PROCESSING_CENTER_DAG_BUILDER",microFrontend:{name:"PROCESSING_CENTER_DAG_BUILDER",config:{ingestionAdapterId:null===p||void 0===p?void 0:p.id,onSave:()=>{t(unmountPanel("PROCESSING_CENTER_DAG_BUILDER")),t(actions$4.resetList()),t(actions$4.fetchDagTemplatesStart())}}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:r?0:55,marginStart:r?0:80,size:"xlarge",parentPanelId:"PROCESSING_CENTER_INGESTION",dimmedStatus:"dimParent"}}))},"data-testid":"pc-dag-templates-create-template-button",variant:"contained"},{children:SHARED_TEXT.processing.createNewTemplate()}))]})),!n&&o&&jsxRuntime.exports.jsx(ErrorState,{onRetry:()=>{t(actions$4.fetchDagTemplatesStart())},errorMessage:jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:SHARED_TEXT.processing.errorState()})}),!o&&jsxRuntime.exports.jsxs("div",Object.assign({className:e.templateListContainer},{children:[d&&jsxRuntime.exports.jsx(DagTemplatesLoadingState,{}),!d&&jsxRuntime.exports.jsx(DagTemplateList,{onSelectTemplate:e=>{e===s?(t(actions$4.clearSelectedDagTemplate()),t(actions$4.clearDagTemplateId())):(t(actions$4.setDagTemplateId(null==e?void 0:e.id)),t(actions$4.setSelectedDagTemplate(e)))}})]})),s||0<c.length?jsxRuntime.exports.jsx(PanelControls$1,{disableNext:!s||0<c.length,disableBack:!1,nextButtonType:l?ENextButtonType.UPDATE_SCHEDULED_JOB:ENextButtonType.NEXT}):jsxRuntime.exports.jsx(PanelControls$1,{disableNext:!1,disableBack:!1,nextButtonType:l?ENextButtonType.UPDATE_SCHEDULED_JOB:ENextButtonType.CUSTOM_NEXT,onClickNext:()=>{t(actions$4.createIngestOnlyDagTemplateStart())}})]}))};export{ProcessingStep as default};
Binary file
package/js-core.esm19.js CHANGED
@@ -1 +1 @@
1
- import{aq as unmountPanel$1,a1 as hidePanel$1,dR as unmountAllPanel$1,dS as getUniqueID,ar as mountPanel$1,bI as AvailableWidgets,bH as updatePanelMicroFrontendProps,dT as mountWidget,dU as unmountWidget,dV as updateTokenRequest,dW as HelpCenter,D as takeEvery$1,dX as mountPanelForResponse$1,dY as DataCenter,E as select}from"./js-core.esm.js";import{s as setData,b as logout,u as updateActivityStatus}from"./js-core.esm4.js";import{setCustomKnowledgeBaseUrl,setCustomDocsUrl,updateSelectedTab}from"./js-core.esm20.js";import"./js-core.esm5.js";import"./js-core.esm7.js";class RateLimiter{constructor(){this.lastCall=null}checkIfCanCall(e=1){return e<1&&(e=1),(!this.lastCall||(new Date).getTime()-this.lastCall>=6e4*e)&&(this.lastCall=(new Date).getTime(),!0)}}const rateLimiter=new RateLimiter,createAuthHelpers=t=>({updateToken(e){e?t.dispatch(updateTokenRequest({token:e})):console.error("[AiWARE JS]: Please provide a valid token!")},logout(e){"function"==typeof e?(e(),setTimeout(()=>{t.dispatch(logout())},1e3)):t.dispatch(logout())},reportAppActivity(e){rateLimiter.checkIfCanCall(e)&&t.dispatch(updateActivityStatus())}}),helpCenter=()=>{var e=new HelpCenter({actions:{setCustomKnowledgeBaseUrlAction:setCustomKnowledgeBaseUrl,setCustomDocsUrlAction:setCustomDocsUrl,updateSelectedTabAction:updateSelectedTab}});return{openKnowledgeBasePanel:e.openKnowledgeBasePanel.bind(e),openDocsPanel:e.openDocsPanel.bind(e)}},dataCenter=()=>{var e=new DataCenter;return{openImporterPanel:e.openImporterPanel.bind(e)}},unmountPanel=t=>e=>(t.dispatch(unmountPanel$1(e)),!0),hidePanel=t=>e=>(t.dispatch(hidePanel$1(e)),!0),unmountAllPanel=e=>()=>{e.dispatch(unmountAllPanel$1(""))},mountPanel=s=>(e,t)=>{const n=e.panelId||getUniqueID();var{microFrontend:e,panelConfig:a}=e;s.dispatch(mountPanel$1({microFrontend:e,panelId:n,panelConfig:a}));const o=[...(null==(e=null==a?void 0:a.header)?void 0:e.actions)||[],...(null==(e=null==a?void 0:a.footer)?void 0:e.actions)||[]].filter(e=>e.submit).map(e=>e.action);a={id:n,sagas:[function*(){yield takeEvery$1(o.map(e=>e.type),function*(){var e=(yield select(e=>e.data.find(e=>e.id===n)))["data"];t&&t(e)})}]};return s.addModule(a),n},mountPanelForResponse=t=>e=>mountPanelForResponse$1(e,t),attachSdkToWindow=e=>{var{init:e,store:t,aiwareEvents:n,bootstrapOptions:a}=e;!window||void 0!==window.aiware&&0!==Object.keys(window.aiware).length||(window.aiware={init:e,store:t,auth:createAuthHelpers(t),helpCenter:helpCenter(),dataCenter:dataCenter(),on:n.on,off:n.off,hidePanel:hidePanel(t),unmountPanel:unmountPanel(t),mountPanel:mountPanel(t),mountPanelForResponse:mountPanelForResponse(t),registry:a.registry,registryLookup:a.registryLookup,AvailableWidgets:AvailableWidgets,mountPanelAction:mountPanel$1,unmountPanelAction:unmountPanel$1,hidePanelAction:hidePanel$1,updatePanelMicroFrontendPropsAction:updatePanelMicroFrontendProps,setData:setData,mountWidget:mountWidget,unmountWidget:unmountWidget,version:"sdk_release_version",commit:"c8bee9d76",releaseDate:"sdk_release_date"})};export{attachSdkToWindow,hidePanel,mountPanel,unmountAllPanel,unmountPanel};
1
+ import{aq as unmountPanel$1,a1 as hidePanel$1,dR as unmountAllPanel$1,dS as getUniqueID,ar as mountPanel$1,bI as AvailableWidgets,bH as updatePanelMicroFrontendProps,dT as mountWidget,dU as unmountWidget,dV as updateTokenRequest,dW as HelpCenter,D as takeEvery$1,dX as mountPanelForResponse$1,dY as DataCenter,E as select}from"./js-core.esm.js";import{s as setData,b as logout,u as updateActivityStatus}from"./js-core.esm4.js";import{setCustomKnowledgeBaseUrl,setCustomDocsUrl,updateSelectedTab}from"./js-core.esm20.js";import"./js-core.esm5.js";import"./js-core.esm7.js";class RateLimiter{constructor(){this.lastCall=null}checkIfCanCall(e=1){return e<1&&(e=1),(!this.lastCall||(new Date).getTime()-this.lastCall>=6e4*e)&&(this.lastCall=(new Date).getTime(),!0)}}const rateLimiter=new RateLimiter,createAuthHelpers=t=>({updateToken(e){e?t.dispatch(updateTokenRequest({token:e})):console.error("[AiWARE JS]: Please provide a valid token!")},logout(e){"function"==typeof e?(e(),setTimeout(()=>{t.dispatch(logout())},1e3)):t.dispatch(logout())},reportAppActivity(e){rateLimiter.checkIfCanCall(e)&&t.dispatch(updateActivityStatus())}}),helpCenter=()=>{var e=new HelpCenter({actions:{setCustomKnowledgeBaseUrlAction:setCustomKnowledgeBaseUrl,setCustomDocsUrlAction:setCustomDocsUrl,updateSelectedTabAction:updateSelectedTab}});return{openKnowledgeBasePanel:e.openKnowledgeBasePanel.bind(e),openDocsPanel:e.openDocsPanel.bind(e)}},dataCenter=()=>{var e=new DataCenter;return{openImporterPanel:e.openImporterPanel.bind(e)}},unmountPanel=t=>e=>(t.dispatch(unmountPanel$1(e)),!0),hidePanel=t=>e=>(t.dispatch(hidePanel$1(e)),!0),unmountAllPanel=e=>()=>{e.dispatch(unmountAllPanel$1(""))},mountPanel=s=>(e,t)=>{const n=e.panelId||getUniqueID();var{microFrontend:e,panelConfig:a}=e;s.dispatch(mountPanel$1({microFrontend:e,panelId:n,panelConfig:a}));const o=[...(null==(e=null==a?void 0:a.header)?void 0:e.actions)||[],...(null==(e=null==a?void 0:a.footer)?void 0:e.actions)||[]].filter(e=>e.submit).map(e=>e.action);a={id:n,sagas:[function*(){yield takeEvery$1(o.map(e=>e.type),function*(){var e=(yield select(e=>e.data.find(e=>e.id===n)))["data"];t&&t(e)})}]};return s.addModule(a),n},mountPanelForResponse=t=>e=>mountPanelForResponse$1(e,t),attachSdkToWindow=e=>{var{init:e,store:t,aiwareEvents:n,bootstrapOptions:a}=e;!window||void 0!==window.aiware&&0!==Object.keys(window.aiware).length||(window.aiware={init:e,store:t,auth:createAuthHelpers(t),helpCenter:helpCenter(),dataCenter:dataCenter(),on:n.on,off:n.off,hidePanel:hidePanel(t),unmountPanel:unmountPanel(t),mountPanel:mountPanel(t),mountPanelForResponse:mountPanelForResponse(t),registry:a.registry,registryLookup:a.registryLookup,AvailableWidgets:AvailableWidgets,mountPanelAction:mountPanel$1,unmountPanelAction:unmountPanel$1,hidePanelAction:hidePanel$1,updatePanelMicroFrontendPropsAction:updatePanelMicroFrontendProps,setData:setData,mountWidget:mountWidget,unmountWidget:unmountWidget,version:"sdk_release_version",commit:"b20d9f15b",releaseDate:"sdk_release_date"})};export{attachSdkToWindow,hidePanel,mountPanel,unmountAllPanel,unmountPanel};
Binary file