@hiver/connector-admin 4.1.1 → 4.1.3-adminPerformace-beta.0
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/index.es.js +2 -2
- package/index.umd.js +2 -2
- package/package.json +1 -1
- package/testing/setup-test.d.ts.map +1 -1
- package/v2/testing/setup-test.d.ts.map +1 -1
package/index.es.js
CHANGED
|
@@ -27483,7 +27483,7 @@ const Wk = {
|
|
|
27483
27483
|
};
|
|
27484
27484
|
Z0.ROW_ID = fo;
|
|
27485
27485
|
const Jk = T(pe)`
|
|
27486
|
-
box-sizing:
|
|
27486
|
+
box-sizing: border-box;
|
|
27487
27487
|
&:not(:has(.${$i})) {
|
|
27488
27488
|
transform: translate(0, 5px);
|
|
27489
27489
|
padding-bottom: 5px;
|
|
@@ -31000,7 +31000,7 @@ const _a = {
|
|
|
31000
31000
|
onClick: () => g(e),
|
|
31001
31001
|
children: [
|
|
31002
31002
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
31003
|
-
t ? /* @__PURE__ */ u.jsx("div", { className: "w-8.75 h-8.75 shadow-icon rounded-md overflow-hidden", children: /* @__PURE__ */ u.jsx("img", { src: t, alt: `${n} logo`, className: "w-full h-full" }) }) : null,
|
|
31003
|
+
t ? /* @__PURE__ */ u.jsx("div", { className: "w-8.75 h-8.75 shadow-icon rounded-md overflow-hidden", children: /* @__PURE__ */ u.jsx("img", { src: t, alt: `${n} logo`, className: "w-full h-full", loading: "lazy" }) }) : null,
|
|
31004
31004
|
/* @__PURE__ */ u.jsx("div", { className: "text-body1", children: n })
|
|
31005
31005
|
] }),
|
|
31006
31006
|
E(),
|
package/index.umd.js
CHANGED
|
@@ -1110,7 +1110,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1110
1110
|
margin: var(--v-margin) var(--h-margin);
|
|
1111
1111
|
}
|
|
1112
1112
|
`,YF=({onChange:e,onFocus:t,onBlur:n,...r})=>{const A=(o,s)=>{e==null||e(o,s)};return u.jsx(zF,{onChange:A,onFocus:t,onBlur:n,...r})},JF="/v1/api"+"/templates/metadata",XF={GET:"GET",POST:"POST",DELETE:"DELETE",PATCH:"PATCH",PUT:"PUT"},UF=async e=>{const t=new URLSearchParams,{inboxIds:n,channelType:r,conversationId:A,fetchAuthenticatedConnectors:o}=e||{};return n==null||n.forEach(i=>{t.append("inbox_ids",i)}),[["channel_type",r],["conversation_id",A],["fetch_authenticated_connectors",o==null?void 0:o.toString()]].forEach(([i,a])=>{a!==void 0&&t.append(i,a)}),At({url:`${JF}?${t.toString()}`,method:XF.GET})};var Xd=(e=>(e.ADD="ADD",e.MULTIPLY="MULTIPLY",e))(Xd||{});const qF={[Xd.ADD]:(e,t)=>e+t,[Xd.MULTIPLY]:(e,t)=>e*t},ZF=e=>e,um=()=>{if("crypto"in window&&"randomUUID"in window.crypto)return window.crypto.randomUUID();const e=Date.now().toString(16),t=Math.random().toString(16).substring(2,8);return`${e}-${t}`},gm=(e,t)=>{let n;const r=qF[t]??ZF;for(const A of e){const o=Number(A);isNaN(o)||(n=n===void 0?o:r(n,o))}return(n??0).toFixed(2)},dm=({label:e,isRequired:t,prefixNode:n,...r})=>e?u.jsxs(g.Typography,{variant:"h4",component:"label",color:g.theme.palette.gray.gray1,className:"hiver__field--label",...r,children:[n,e,t?u.jsx("span",{className:"required__star",children:"*"}):null]}):null,KF=e=>_.createElement("svg",{width:"8px",height:"8px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),Cm=250,po="__id",Ra={isExpandable:!0,isExpanded:!0,defaultNumberOfRows:1,fixedRows:!1,cellWidth:Cm,arithmeticOperation:[]},Em=({name:e,value:t,data:n={},columns:r=[],validation:A={},meta:{defaultNumberOfRows:o=Ra.defaultNumberOfRows,fixedRows:s=Ra.fixedRows,cellWidth:i=Ra.cellWidth,arithmeticOperation:a=Ra.arithmeticOperation}=Ra,fetchConfig:l={},createConfig:c={},stackIndex:d,onChange:I=()=>{},onFocus:Q,onValidationError:f})=>{const C=t??[],E=(A==null?void 0:A.validations)??{},B=y.useRef(),p=y.useRef({}),[h,m]=y.useState({}),{colsLength:v,colsTemplate:x,colWidth:w}=y.useMemo(()=>{let D=0,O="";for(const k of r){let X=k.cols?Number(k.cols):1;isNaN(X)&&(X=1),D+=X,O+=`${k.cols??X}fr `}return s||(D+=.5,O+="0.5fr"),{colsLength:D,colsTemplate:O.trim(),colWidth:`${isNaN(i)?Cm:i}px`}},[r,i,s]),{fieldDependency:b,fieldConfigs:T}=y.useMemo(()=>{const D={},O={};for(const k of r){if(!k.valueConfig)continue;O[k.name]=k.valueConfig;const X=k.valueConfig.columnNames;for(const q of X)D[q]||(D[q]=[]),D[q].push(k.name)}return{fieldDependency:D,fieldConfigs:O}},[r]);y.useEffect(()=>{if(t)return;const D=[];for(let O=0;O<o;O++){const k=um();D.push({[po]:k})}I(D)},[t,I,o]);const j=()=>{const D=Object.entries(p.current).filter(O=>!!O[1])[0];return(D==null?void 0:D[1])??""},P=()=>{const D={[po]:um()};I([...C,D])},V=D=>{const O=C.filter(k=>k[po]!==D);I(O),m(k=>({...k,[D]:{}}));for(const k in p.current)k.startsWith(`${D}.`)&&delete p.current[k];f==null||f(e,j())},J=(D,{columnNames:O=[],operationType:k})=>{const X=O.map(q=>D[q]);return""+gm(X,k)},M=(D,O)=>{const k=C.map(X=>D!==X[po]?X:{...X,...O});I(k)},se=(D,O)=>{const k=C.map(X=>{if(D!==X[po])return X;const q={...X};for(const te of O)delete q[te];return q});I(k)},ue=(D,O,k,X)=>{var ce;const q=((ce=X==null?void 0:X.target)==null?void 0:ce.value)??"",te={...k,[O]:q};if(b[O])for(const ne of b[O]){const ie=J(te,T[ne]);te[ne]=ie}M(D,te)},he=(D,O,k)=>{M(D,{[O]:k})},me=(D,O,k,X)=>{if(k&&typeof k=="object"&&"value"in k&&typeof k.value=="string"&&typeof X.name<"u"){const q="prefillValues"in k&&k.prefillValues,te={...O,[X.name]:k.value,...q};for(const ce in te)if(b[ce])for(const ne of b[ce]){const ie=J(te,T[ne]);te[ne]=ie}M(D,te)}(X==null?void 0:X.action)==="clear"&&X.name&&se(D,[X.name])},oe=(D,O,k)=>{M(D,{[O]:(k==null?void 0:k.toISOString())??""})},H=(D,O,k,X)=>{X&&m(q=>{const te=q[D]??{};return{...q,[D]:{...te,[O]:k}}}),p.current={...p.current,[`${D}.${O}`]:typeof k=="string"?k:""},f==null||f(e,j())},G=D=>B.current===D;return u.jsxs(NF,{children:[u.jsx(kF,{ref:B,children:u.jsxs(PF,{gridColumns:x,minWidth:`calc( ${v} * ${w} )`,children:[u.jsx(MF,{children:r.map(({name:D,label:O,isRequired:k})=>u.jsx(Jd,{children:u.jsx(dm,{label:O,isRequired:k})},D))}),C.map(({[po]:D,...O})=>u.jsxs(lm,{children:[r.map(({name:k,key:X,...q})=>{var te;return u.jsx(Jd,{hasError:!!((te=h==null?void 0:h[D])!=null&&te[k]),children:u.jsx(Bm,{name:k,value:O[k],...q,className:gs,label:"",hideHelperText:!0,validation:E==null?void 0:E[k],onFocus:Q,inputChangeHandler:ce=>ue(D,k,O,ce),checkboxChangeHandler:(...ce)=>he(D,k,ce[1]),selectChangeHandler:(...ce)=>me(D,O,...ce),dateChangeHandler:(ce,ne)=>oe(D,ce,ne),onValidationError:(...ce)=>H(D,...ce),fetchConfig:l==null?void 0:l[k],createConfig:c==null?void 0:c[k],isScrollTarget:G,...d?{menuPortalTarget:document.body,stackIndex:d}:null})},k??X)}),s?null:u.jsx(Jd,{children:u.jsx(g.Stack,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",children:u.jsx(cm,{onClick:()=>V(D),children:u.jsx(KF,{})})})})]},D))]})}),u.jsxs(FF,{children:[s?null:u.jsxs(jF,{onClick:P,children:[u.jsx(im,{}),u.jsx(g.Typography,{children:"Add Line"})]}),a.length?u.jsx(GF,{children:a.map(({label:D,columnName:O,operationType:k,prefix:X="",prefixKey:q,suffix:te="",suffixKey:ce})=>u.jsxs(VF,{children:[u.jsx(g.Typography,{fontWeight:500,children:D}),u.jsxs(g.Typography,{children:[u.jsxs("span",{children:[n[q]??X," "]}),u.jsx("span",{children:gm(C.map(ne=>ne[O]),k)}),u.jsx("span",{children:n[ce]??te})]})]},D))}):null]})]})};Em.ROW_ID=po;const $F=g.styled(g.Box)`
|
|
1113
|
-
box-sizing:
|
|
1113
|
+
box-sizing: border-box;
|
|
1114
1114
|
&:not(:has(.${gs})) {
|
|
1115
1115
|
transform: translate(0, 5px);
|
|
1116
1116
|
padding-bottom: 5px;
|
|
@@ -2475,7 +2475,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2475
2475
|
height: 20px;
|
|
2476
2476
|
background: linear-gradient(to right, #ffe250, #ffc350);
|
|
2477
2477
|
color: ${g.palette.gray.gray1};
|
|
2478
|
-
`,A0=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_9869_28517)"},_.createElement("path",{d:"M10 16.6666C6.32502 16.6666 3.33335 13.675 3.33335 9.99996C3.33335 6.32496 6.32502 3.33329 10 3.33329C13.675 3.33329 16.6667 6.32496 16.6667 9.99996C16.6667 13.675 13.675 16.6666 10 16.6666ZM10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333ZM9.16669 9.99996V13.3333H10.8334V9.99996H13.3334L10 6.66663L6.66669 9.99996H9.16669Z",fill:"#506DFF"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_9869_28517"},_.createElement("rect",{width:20,height:20,fill:"white"})))),o0=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_9681_423226)"},_.createElement("path",{d:"M9.99996 1.66663C5.39996 1.66663 1.66663 5.39996 1.66663 9.99996C1.66663 14.6 5.39996 18.3333 9.99996 18.3333C14.6 18.3333 18.3333 14.6 18.3333 9.99996C18.3333 5.39996 14.6 1.66663 9.99996 1.66663ZM9.99996 16.6666C6.31663 16.6666 3.33329 13.6833 3.33329 9.99996C3.33329 8.45829 3.85829 7.04163 4.74163 5.91663L14.0833 15.2583C12.9583 16.1416 11.5416 16.6666 9.99996 16.6666ZM15.2583 14.0833L5.91663 4.74163C7.04163 3.85829 8.45829 3.33329 9.99996 3.33329C13.6833 3.33329 16.6666 6.31663 16.6666 9.99996C16.6666 11.5416 16.1416 12.9583 15.2583 14.0833Z",fill:"#6F7C90"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_9681_423226"},_.createElement("rect",{width:20,height:20,fill:"white"})))),AC=({id:e,logo:t,name:n,replacementName:r,isEnabled:A,isAuthenticated:o,showUpgradeButton:s,isDeprecated:i,showIcons:a,showTooltip:l,showNewChip:c,onClick:d})=>{const I=()=>{if(!a)return null;switch(!0){case!o:return u.jsx(g.icons.ErrorOutline,{sx:{fontSize:"20px"},color:"error"});case!A:return u.jsx(g.icons.InfoOutlined,{sx:{fontSize:"20px"}});case s:return u.jsx(A0,{});case i:return u.jsx(o0,{});default:return u.jsx(g.icons.CheckCircle,{sx:{fontSize:"20px"},color:"success"})}},Q=()=>{if(!l)return null;switch(!0){case!o:return $M;case!A:return n8;case s:return e8;case i:return Is(t8,{connectorName:r||""});default:return""}};return u.jsx(g.Tooltip,{title:Q(),placement:"bottom",arrow:!0,classes:{tooltip:"max-w-[252px]!"},children:u.jsxs("li",{className:`w-65 h-15 flex border-gray-6 border rounded-lg items-center p-3 justify-between cursor-pointer hover:border-gray-2 ${o&&!A?"opacity-70 bg-gray-6a":""}`,onClick:()=>d(e),children:[u.jsxs("div",{className:"flex items-center gap-3",children:[t?u.jsx("div",{className:"w-8.75 h-8.75 shadow-icon rounded-md overflow-hidden",children:u.jsx("img",{src:t,alt:`${n} logo`,className:"w-full h-full"})}):null,u.jsx("div",{className:"text-body1",children:n})]}),I(),u.jsx(Ja,{hidden:!c,label:rC})]},e)})},lj=()=>{const{sendTrackingEvent:e,availableFeatures:t}=y.useContext(Vt),n=on(),r=Ve(Gm),A=Ve(Ic),o=Ve(f8),s=i=>{var c;const a=jm({isTemplate:!0}),l=(c=A==null?void 0:A[i])==null?void 0:c.name;e(et.LIBRARY_CARD_CLICKED,{connector_name:l}),e(et.INTEGRATION_APP_CARD_CLICK,{app_name:l,app_state:a}),n(`${Ye.BASEPATH}${Ye.API_VIEW}/${i}`)};return u.jsx("ul",{className:"flex gap-5 flex-wrap","data-testid":"connector-library",children:o===Be.LOADING?u.jsx(_c,{}):u.jsx(u.Fragment,{children:r.map(i=>{const a=A==null?void 0:A[i];if(!a)return null;const{isTemplateNew:l}=a,c=Ga(t)&&l;return u.jsx(AC,{id:a.id,name:a.name,logo:a.logo,isDeprecated:a.isDeprecated,onClick:s,showNewChip:c,isEnabled:!0},i)})})})},s0=e=>e.connectorLirary.connectorList,Dc=e=>e.connectorLirary.connectors,oC=e=>e.connectorLirary.connectorsApiStatus,a0=e=>e.connectorLirary.currentUpdatingConnectors,Oc=e=>e.connectorLirary.connectorDetailApiStatus,sC=e=>e.connectorLirary.rolesAndPermissions,cj=e=>e.connectorLirary.updateEnableConnectorsApiStatus,uj=e=>e.connectorLirary.cardCustomFields,gj=e=>e.connectorLirary.cardCustomFieldsApiStatus,dj=e=>e.connectorLirary.notAuthenticatedConnectors,Cj=e=>e.connectorLirary.requireUpgradeConnectors,Ej=e=>e.connectorLirary.enableCustomCardApiStatus,Ij=e=>e.connectorLirary.updateConnectorByIdApiStatus,Lc=({id:e,status:t,connectorName:n,hideCta:r=!1})=>{const A=on(),o=()=>{A(`${Ye.BASEPATH}${Ye.CONNECTOR_SETTINGS}/${e}?isEdit=true`)},s=()=>r?null:u.jsx(g.Button,{size:"small",variant:"outlined",className:"ml-2.5! hover:bg-[#e3e9ff]! hover:text-[#506dff]! hover:border-[#506dff]!",onClick:o,children:"Re-Authenticate"});switch(t){case"upgrade":return u.jsxs(g.Alert,{severity:"info",icon:u.jsx(A0,{}),className:"bg-[#F0F3FF]! w-fit h-auto!",children:[Xs(r8,{connectorName:n}),s()]});case"notAuthenticated":return u.jsxs(g.Alert,{severity:"error",icon:u.jsx(g.icons.ErrorOutline,{sx:{fontSize:"20px"},color:"error"}),className:"bg-[#FFE6E6]! w-fit h-auto!",children:[Xs(A8,{connectorName:n}),s()]});case"deprecated":return u.jsx(g.Alert,{severity:"error",icon:u.jsx(o0,{className:"**:[path]:fill-red-hover"}),className:"bg-[#FFE0E3]! w-fit h-auto!",children:u.jsx("span",{className:"text-red-hover",children:Xs(o8,{connectorName:n})})});default:return null}},fj=()=>{const{sendTrackingEvent:e}=y.useContext(Vt),t=Ve(s0),n=Ve(Dc),r=Ve(dj),A=Ve(Cj),o=on(),s=i=>{const{id:a,name:l,isAuthenticated:c,showUpgradeButton:d,isEnabled:I}=i,Q=jm({connector:i}),f=!c||I&&d?0:1;e(et.INTEGRATION_APP_CARD_CLICK,{app_name:l,app_state:Q}),o(`${Ye.BASEPATH}${Ye.CONNECTOR_SETTINGS}/${a}?isEdit=true&tabIndex=${f}`)};return u.jsxs(u.Fragment,{children:[r.length||A.length?u.jsxs("div",{className:"flex gap-4 flex-col mb-4",children:[r.map(i=>{const a=n==null?void 0:n[i];return a?u.jsx(Lc,{id:a.id,status:"notAuthenticated",connectorName:a.name},a.id):null}),A.map(i=>{const a=n==null?void 0:n[i];return a?u.jsx(Lc,{id:a.id,status:"upgrade",connectorName:a.name},a.id):null})]}):null,u.jsx("ul",{className:"flex gap-5 flex-wrap","data-testid":"connector-custom-card",children:t.map(i=>{var a;return(a=n==null?void 0:n[i])!=null&&a.id?u.jsx(AC,{id:n[i].id,name:n[i].name,logo:n[i].logo,isEnabled:n[i].isEnabled,isAuthenticated:n[i].isAuthenticated,showUpgradeButton:n[i].showUpgradeButton,isDeprecated:n[i].isDeprecated,showIcons:!0,showTooltip:!0,onClick:()=>s(n[i])},i):null})})]})},Bj="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_825_73646)'%3e%3cpath%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_825_73646'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",aC=({shown:e,setShown:t,children:n,showCloseButton:r=!1,customPaperProps:A={},onClose:o})=>{const s=()=>{t(!1),o==null||o()};return u.jsx(g.Dialog,{"data-testid":"modal",open:e,className:"connectorAdmin-portal",onClose:s,PaperProps:{style:{borderRadius:12,padding:0,height:"fit-content",width:"fit-content",maxWidth:"none",...A}},children:u.jsxs(g.Stack,{direction:"row",children:[r&&u.jsx(g.Box,{position:"absolute",right:10,top:10,children:u.jsx(g.Tooltip,{title:"Close",placement:"bottom",children:u.jsx(g.IconButton,{onClick:s,"data-testid":"close-modal",children:u.jsx("img",{src:Bj})})})}),n]})})},i0=e=>e.requestConnectorApi.connectorRequestsApiStatus,pj=e=>e.requestConnectorApi.requestableConnectors,hj=e=>e.requestConnectorApi.requestableApis,Qj=({connectors:e,canSubmit:t,setSelectedConnectors:n,selectedConnectors:r,setOptionalDetails:A,handleSubmit:o,isApiText:s})=>{const{sendTrackingEvent:i}=y.useContext(Vt),l=Ve(i0)===Be.LOADING,c=r.length===0?s?h7:Q7:"";return y.useEffect(()=>{i(s?et.REQUEST_NEW_FEATURE_SHOWN:et.REQUEST_NEW_CONNECTOR_SHOWN)},[i,s]),u.jsx(g.Stack,{"data-testid":"request-panel",children:u.jsxs(g.Stack,{padding:"30px",height:"100%",children:[u.jsx(g.Stack,{width:"440px",height:"100%",children:u.jsxs(g.Stack,{gap:"14px",children:[u.jsxs(g.Stack,{gap:"4px",marginBottom:"36px",children:[u.jsx(g.Typography,{variant:"h2",children:s?B7:qm}),u.jsx(g.Typography,{variant:"body2",children:s?p7:Zm})]}),u.jsx(g.Autocomplete,{"data-testid":"request-dropdown",disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,disabled:l,isOptionEqualToValue:(d,I)=>d.id===I.id,renderOption:(d,I,{selected:Q})=>{const{key:f,...C}=d;return u.jsxs(g.Box,{component:"li",...C,minHeight:"36px",children:[u.jsx(g.Checkbox,{style:{marginRight:8},checked:Q}),I.label]},f)},renderInput:d=>u.jsx(nC,{...d,variant:"outlined",placeholder:c}),ListboxProps:{style:{maxHeight:250}},onChange:(d,I)=>{n(I)}}),u.jsx(Km,{multiline:!0,fullWidth:!0,minRows:8,variant:"outlined",disabled:l,placeholder:m7,onChange:d=>{A(d.target.value)}})]})}),u.jsx(g.Stack,{alignItems:"flex-end",children:u.jsx(g.Button,{"data-testid":"submit-request-button",onClick:o,color:"tertiary",size:"medium",sx:{height:"32px"},disabled:!t||l,children:l?u.jsx(g.CircularProgress,{sx:{color:"#97A3B7"},size:20}):u.jsx("div",{children:y7})})})]})})},l0="data:image/svg+xml,%3csvg%20width='92'%20height='92'%20viewBox='0%200%2092%2092'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='46'%20cy='46'%20r='23'%20fill='%2336A40F'/%3e%3ccircle%20opacity='0.1'%20cx='45.5'%20cy='45.5'%20r='34.5'%20fill='%235AAA3D'/%3e%3ccircle%20opacity='0.1'%20cx='46'%20cy='46'%20r='46'%20fill='%232CAA00'/%3e%3cpath%20d='M37%2046L44%2053L58%2039'%20stroke='white'%20stroke-width='3'/%3e%3c/svg%3e",mj=g.styled(g.Box)`
|
|
2478
|
+
`,A0=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_9869_28517)"},_.createElement("path",{d:"M10 16.6666C6.32502 16.6666 3.33335 13.675 3.33335 9.99996C3.33335 6.32496 6.32502 3.33329 10 3.33329C13.675 3.33329 16.6667 6.32496 16.6667 9.99996C16.6667 13.675 13.675 16.6666 10 16.6666ZM10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333ZM9.16669 9.99996V13.3333H10.8334V9.99996H13.3334L10 6.66663L6.66669 9.99996H9.16669Z",fill:"#506DFF"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_9869_28517"},_.createElement("rect",{width:20,height:20,fill:"white"})))),o0=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_9681_423226)"},_.createElement("path",{d:"M9.99996 1.66663C5.39996 1.66663 1.66663 5.39996 1.66663 9.99996C1.66663 14.6 5.39996 18.3333 9.99996 18.3333C14.6 18.3333 18.3333 14.6 18.3333 9.99996C18.3333 5.39996 14.6 1.66663 9.99996 1.66663ZM9.99996 16.6666C6.31663 16.6666 3.33329 13.6833 3.33329 9.99996C3.33329 8.45829 3.85829 7.04163 4.74163 5.91663L14.0833 15.2583C12.9583 16.1416 11.5416 16.6666 9.99996 16.6666ZM15.2583 14.0833L5.91663 4.74163C7.04163 3.85829 8.45829 3.33329 9.99996 3.33329C13.6833 3.33329 16.6666 6.31663 16.6666 9.99996C16.6666 11.5416 16.1416 12.9583 15.2583 14.0833Z",fill:"#6F7C90"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_9681_423226"},_.createElement("rect",{width:20,height:20,fill:"white"})))),AC=({id:e,logo:t,name:n,replacementName:r,isEnabled:A,isAuthenticated:o,showUpgradeButton:s,isDeprecated:i,showIcons:a,showTooltip:l,showNewChip:c,onClick:d})=>{const I=()=>{if(!a)return null;switch(!0){case!o:return u.jsx(g.icons.ErrorOutline,{sx:{fontSize:"20px"},color:"error"});case!A:return u.jsx(g.icons.InfoOutlined,{sx:{fontSize:"20px"}});case s:return u.jsx(A0,{});case i:return u.jsx(o0,{});default:return u.jsx(g.icons.CheckCircle,{sx:{fontSize:"20px"},color:"success"})}},Q=()=>{if(!l)return null;switch(!0){case!o:return $M;case!A:return n8;case s:return e8;case i:return Is(t8,{connectorName:r||""});default:return""}};return u.jsx(g.Tooltip,{title:Q(),placement:"bottom",arrow:!0,classes:{tooltip:"max-w-[252px]!"},children:u.jsxs("li",{className:`w-65 h-15 flex border-gray-6 border rounded-lg items-center p-3 justify-between cursor-pointer hover:border-gray-2 ${o&&!A?"opacity-70 bg-gray-6a":""}`,onClick:()=>d(e),children:[u.jsxs("div",{className:"flex items-center gap-3",children:[t?u.jsx("div",{className:"w-8.75 h-8.75 shadow-icon rounded-md overflow-hidden",children:u.jsx("img",{src:t,alt:`${n} logo`,className:"w-full h-full",loading:"lazy"})}):null,u.jsx("div",{className:"text-body1",children:n})]}),I(),u.jsx(Ja,{hidden:!c,label:rC})]},e)})},lj=()=>{const{sendTrackingEvent:e,availableFeatures:t}=y.useContext(Vt),n=on(),r=Ve(Gm),A=Ve(Ic),o=Ve(f8),s=i=>{var c;const a=jm({isTemplate:!0}),l=(c=A==null?void 0:A[i])==null?void 0:c.name;e(et.LIBRARY_CARD_CLICKED,{connector_name:l}),e(et.INTEGRATION_APP_CARD_CLICK,{app_name:l,app_state:a}),n(`${Ye.BASEPATH}${Ye.API_VIEW}/${i}`)};return u.jsx("ul",{className:"flex gap-5 flex-wrap","data-testid":"connector-library",children:o===Be.LOADING?u.jsx(_c,{}):u.jsx(u.Fragment,{children:r.map(i=>{const a=A==null?void 0:A[i];if(!a)return null;const{isTemplateNew:l}=a,c=Ga(t)&&l;return u.jsx(AC,{id:a.id,name:a.name,logo:a.logo,isDeprecated:a.isDeprecated,onClick:s,showNewChip:c,isEnabled:!0},i)})})})},s0=e=>e.connectorLirary.connectorList,Dc=e=>e.connectorLirary.connectors,oC=e=>e.connectorLirary.connectorsApiStatus,a0=e=>e.connectorLirary.currentUpdatingConnectors,Oc=e=>e.connectorLirary.connectorDetailApiStatus,sC=e=>e.connectorLirary.rolesAndPermissions,cj=e=>e.connectorLirary.updateEnableConnectorsApiStatus,uj=e=>e.connectorLirary.cardCustomFields,gj=e=>e.connectorLirary.cardCustomFieldsApiStatus,dj=e=>e.connectorLirary.notAuthenticatedConnectors,Cj=e=>e.connectorLirary.requireUpgradeConnectors,Ej=e=>e.connectorLirary.enableCustomCardApiStatus,Ij=e=>e.connectorLirary.updateConnectorByIdApiStatus,Lc=({id:e,status:t,connectorName:n,hideCta:r=!1})=>{const A=on(),o=()=>{A(`${Ye.BASEPATH}${Ye.CONNECTOR_SETTINGS}/${e}?isEdit=true`)},s=()=>r?null:u.jsx(g.Button,{size:"small",variant:"outlined",className:"ml-2.5! hover:bg-[#e3e9ff]! hover:text-[#506dff]! hover:border-[#506dff]!",onClick:o,children:"Re-Authenticate"});switch(t){case"upgrade":return u.jsxs(g.Alert,{severity:"info",icon:u.jsx(A0,{}),className:"bg-[#F0F3FF]! w-fit h-auto!",children:[Xs(r8,{connectorName:n}),s()]});case"notAuthenticated":return u.jsxs(g.Alert,{severity:"error",icon:u.jsx(g.icons.ErrorOutline,{sx:{fontSize:"20px"},color:"error"}),className:"bg-[#FFE6E6]! w-fit h-auto!",children:[Xs(A8,{connectorName:n}),s()]});case"deprecated":return u.jsx(g.Alert,{severity:"error",icon:u.jsx(o0,{className:"**:[path]:fill-red-hover"}),className:"bg-[#FFE0E3]! w-fit h-auto!",children:u.jsx("span",{className:"text-red-hover",children:Xs(o8,{connectorName:n})})});default:return null}},fj=()=>{const{sendTrackingEvent:e}=y.useContext(Vt),t=Ve(s0),n=Ve(Dc),r=Ve(dj),A=Ve(Cj),o=on(),s=i=>{const{id:a,name:l,isAuthenticated:c,showUpgradeButton:d,isEnabled:I}=i,Q=jm({connector:i}),f=!c||I&&d?0:1;e(et.INTEGRATION_APP_CARD_CLICK,{app_name:l,app_state:Q}),o(`${Ye.BASEPATH}${Ye.CONNECTOR_SETTINGS}/${a}?isEdit=true&tabIndex=${f}`)};return u.jsxs(u.Fragment,{children:[r.length||A.length?u.jsxs("div",{className:"flex gap-4 flex-col mb-4",children:[r.map(i=>{const a=n==null?void 0:n[i];return a?u.jsx(Lc,{id:a.id,status:"notAuthenticated",connectorName:a.name},a.id):null}),A.map(i=>{const a=n==null?void 0:n[i];return a?u.jsx(Lc,{id:a.id,status:"upgrade",connectorName:a.name},a.id):null})]}):null,u.jsx("ul",{className:"flex gap-5 flex-wrap","data-testid":"connector-custom-card",children:t.map(i=>{var a;return(a=n==null?void 0:n[i])!=null&&a.id?u.jsx(AC,{id:n[i].id,name:n[i].name,logo:n[i].logo,isEnabled:n[i].isEnabled,isAuthenticated:n[i].isAuthenticated,showUpgradeButton:n[i].showUpgradeButton,isDeprecated:n[i].isDeprecated,showIcons:!0,showTooltip:!0,onClick:()=>s(n[i])},i):null})})]})},Bj="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_825_73646)'%3e%3cpath%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_825_73646'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",aC=({shown:e,setShown:t,children:n,showCloseButton:r=!1,customPaperProps:A={},onClose:o})=>{const s=()=>{t(!1),o==null||o()};return u.jsx(g.Dialog,{"data-testid":"modal",open:e,className:"connectorAdmin-portal",onClose:s,PaperProps:{style:{borderRadius:12,padding:0,height:"fit-content",width:"fit-content",maxWidth:"none",...A}},children:u.jsxs(g.Stack,{direction:"row",children:[r&&u.jsx(g.Box,{position:"absolute",right:10,top:10,children:u.jsx(g.Tooltip,{title:"Close",placement:"bottom",children:u.jsx(g.IconButton,{onClick:s,"data-testid":"close-modal",children:u.jsx("img",{src:Bj})})})}),n]})})},i0=e=>e.requestConnectorApi.connectorRequestsApiStatus,pj=e=>e.requestConnectorApi.requestableConnectors,hj=e=>e.requestConnectorApi.requestableApis,Qj=({connectors:e,canSubmit:t,setSelectedConnectors:n,selectedConnectors:r,setOptionalDetails:A,handleSubmit:o,isApiText:s})=>{const{sendTrackingEvent:i}=y.useContext(Vt),l=Ve(i0)===Be.LOADING,c=r.length===0?s?h7:Q7:"";return y.useEffect(()=>{i(s?et.REQUEST_NEW_FEATURE_SHOWN:et.REQUEST_NEW_CONNECTOR_SHOWN)},[i,s]),u.jsx(g.Stack,{"data-testid":"request-panel",children:u.jsxs(g.Stack,{padding:"30px",height:"100%",children:[u.jsx(g.Stack,{width:"440px",height:"100%",children:u.jsxs(g.Stack,{gap:"14px",children:[u.jsxs(g.Stack,{gap:"4px",marginBottom:"36px",children:[u.jsx(g.Typography,{variant:"h2",children:s?B7:qm}),u.jsx(g.Typography,{variant:"body2",children:s?p7:Zm})]}),u.jsx(g.Autocomplete,{"data-testid":"request-dropdown",disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,disabled:l,isOptionEqualToValue:(d,I)=>d.id===I.id,renderOption:(d,I,{selected:Q})=>{const{key:f,...C}=d;return u.jsxs(g.Box,{component:"li",...C,minHeight:"36px",children:[u.jsx(g.Checkbox,{style:{marginRight:8},checked:Q}),I.label]},f)},renderInput:d=>u.jsx(nC,{...d,variant:"outlined",placeholder:c}),ListboxProps:{style:{maxHeight:250}},onChange:(d,I)=>{n(I)}}),u.jsx(Km,{multiline:!0,fullWidth:!0,minRows:8,variant:"outlined",disabled:l,placeholder:m7,onChange:d=>{A(d.target.value)}})]})}),u.jsx(g.Stack,{alignItems:"flex-end",children:u.jsx(g.Button,{"data-testid":"submit-request-button",onClick:o,color:"tertiary",size:"medium",sx:{height:"32px"},disabled:!t||l,children:l?u.jsx(g.CircularProgress,{sx:{color:"#97A3B7"},size:20}):u.jsx("div",{children:y7})})})]})})},l0="data:image/svg+xml,%3csvg%20width='92'%20height='92'%20viewBox='0%200%2092%2092'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='46'%20cy='46'%20r='23'%20fill='%2336A40F'/%3e%3ccircle%20opacity='0.1'%20cx='45.5'%20cy='45.5'%20r='34.5'%20fill='%235AAA3D'/%3e%3ccircle%20opacity='0.1'%20cx='46'%20cy='46'%20r='46'%20fill='%232CAA00'/%3e%3cpath%20d='M37%2046L44%2053L58%2039'%20stroke='white'%20stroke-width='3'/%3e%3c/svg%3e",mj=g.styled(g.Box)`
|
|
2479
2479
|
.request-new-connector-img {
|
|
2480
2480
|
height: 500px;
|
|
2481
2481
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-test.d.ts","sourceRoot":"","sources":["../../src/testing/setup-test.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"setup-test.d.ts","sourceRoot":"","sources":["../../src/testing/setup-test.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-test.d.ts","sourceRoot":"","sources":["../../../src/v2/testing/setup-test.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"setup-test.d.ts","sourceRoot":"","sources":["../../../src/v2/testing/setup-test.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,2BAA2B,CAAC"}
|