PageSourceSearch

https://www.connectumassalumni.com/static/js/MultiHubSettings.74c3aa83.chunk.min.js

js connectumassalumni.com collected 2026-10-06 21:44:55 UTC 6,597 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkclient_v2=self.webpackChunkclient_v2||[]).push([[7452],{228219:(_,x,n)=>{n.r(x),n.d(x,{default:()=>k});var e=n(715621),a=n(893602),f=n(537953);const ee={};var j=n(839050),v=n(253473),$=n(768835),H=n(283539);const L=({hubs:t,open:u,handleClose:i,...s})=>{const[o,g]=(0,f.useState)(a.A.sortBy(t,["displayOrder"])),d=l=>{var r;if(!l.destination)return;const c=[...o],[b]=c.splice(l.source.index,1);c.splice((r=l.destination)==null?void 0:r.index,0,b),c.forEach((S,F)=>S.displayOrder=F),g(c)},h=l=>{const r=[];return r.push(`hubDisplayOrderModel__dnd__list__card--${l?"accent":"normal"}`),r},p=()=>{var l;const r=a.A.map(o,c=>a.A.pick(c,["id","isDefault","isFeatured","displayOrder","isVisible"]));(l=s==null?void 0:s.onChange)==null||l.call(s,r),i()};return(0,e.jsx)(v.aF,{id:"hubDisplayOrderModel",open:u,onClose:i,title:"Set order",footer:(0,e.jsxs)("div",{className:"hubDisplayOrderModel__ctas",children:[(0,e.jsx)(v.$n,{type:"ghost",onClick:i,children:"Close"}),(0,e.jsx)(v.$n,{type:"success",onClick:p,children:"Save"})]}),children:(0,e.jsx)("div",{className:"hubDisplayOrderModel__dnd",children:(0,e.jsx)(H.JY,{onDragEnd:d,children:(0,e.jsx)(H.gL,{droppableId:"droppable",children:l=>(0,e.jsxs)("div",{...l.droppableProps,ref:l.innerRef,className:"hubDisplayOrderModel__dnd__list",children:[o.map((r,c)=>(0,e.jsx)(H.sx,{draggableId:r.id.toString(),index:c,children:(b,S)=>(0,e.jsx)("div",{ref:b.innerRef,...b.draggableProps,...b.dragHandleProps,className:(0,$.A)(["hubDisplayOrderModel__dnd__list__card",h(S.isDragging)]),children:(0,e.jsx)("h4",{children:r.name})})},r.id)),l.placeholder]})})})})})};var G=n(163081),A=n(996465),O=n(850504);const y=(t,u=!1)=>{if(!t)return[];const i=t==null?void 0:t.map(s=>({label:s.name,value:s.id}));return u&&i.push({label:"None",value:-1}),i},T=()=>[{label:"Never",value:"never"},{label:"Always",value:"always"},{label:"Only after joining the first hub",value:"firstHub"},{label:"Only if user has not joined the Featured Hub",value:"featuredHub"}],C=()=>(0,O.A)("Something went wrong","error"),M=t=>(0,O.A)(t,"success");function U({hubDisplayOrderModelOpen:t,handleHubDisplayOrderModelOpen:u,handleHubDisplayOrderModelClose:i}){const{hubs:s}=(0,j.er)();return{id:"multi-hub-form",fields:(0,f.useMemo)(()=>[{id:"showHubSelectionPage",field:"switch",label:"Always show hub selection page",description:"By default, hub selection page is skipped if user is imported into just one hub. If this setting is enabled, all imported users will be shown the hub selection page.",className:"experienceDateField",inline:!0},{id:"defaultHub",field:"select",label:"Default Hub",description:"Skips the hub selection page for new users signing up",options:y(s,!0)},{id:"featuredHub",field:"select",label:"Featured Hub",description:"This hub will highlight on hub selection step.",options:y(s,!0)},{id:"hubSelectionPageAfterSignup",field:"select",label:"Redirect to hub selection page?",description:"Redirect to hub selection page after initial signup?",options:T()},{id:"displayOrder",field:"component",component:g=>(0,e.jsx)(Z,{title:"Hub display order",description:"Ordering of hub on the hub selection page",actionComponent:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(v.$n,{type:"tertiary",onClick:u,size:"medium",className:"hubDisplayOrder__cta",children:"Set display order"}),(0,e.jsx)(L,{...g,hubs:s!=null?s:[],open:t,handleClose:i})]})})},{id:"hideHubs",field:"autocomplete",label:"Hide Hubs",description:"This will hide hubs from my hubs & sign-up page",multiple:!0,options:y(s),placeholder:"select hubs..."}],[i,u,t,s])}}var P=n(294097);const z=t=>P.E.put("/admin/hubs",{...t}),J=t=>P.E.put("/cluster-setting",{...t});var D=n(283766);function Y(t){return(0,D.useMutation)(z,{...t})}function K(t){return(0,D.useMutation)(J,{...t})}const Q=({intialData:t})=>{const u=(0,G.useDispatch)(),[i,s]=(0,f.useState)(!1),[o,g]=(0,f.useState)(t!=null?t:{}),d=(0,f.useRef)(null),h=Y({onSuccess:()=>{M("Hub settings updated"),u((0,A.e)())},onError:C}),p=K({onSuccess:()=>{M("Cluster settings updated"),u((0,A.e)())},onError:C}),l=()=>{s(!0)},r=()=>{s(!1)},c=async()=>{var S;if(!((S=d.current)!=null&&S.validateForm()))return;const{navBGColor:F,navColor:ae,hubSelectionPageAfterSignup:N,showHubSelectionPage:w,displayOrder:R,defaultHub:E,featuredHub:I,hideHubs:B}=o,V=R==null?void 0:R.value.map(m=>({...m,isDefault:m.id===(E==null?void 0:E.value),isFeatured:m.id===(I==null?void 0:I.value),isVisible:!(B!=null&&B.value.includes(m.id))}));!a.A.isEqual(a.A.sortBy(V,["id"]),a.A.sortBy(t.displayOrder.value,["id"]))&&h.mutate({hub
1s:V}),a.A.chain(o).pick("hubSelectionPageAfterSignup","showHubSelectionPage").filter((m,q)=>!a.A.isEqual(m==null?void 0:m.value,t[q].value)).value().length!==0&&p.mutate({setting:"coreSettings.hubSelectionPageSetting",value:{hubSelectionPageAfterSignup:N==null?void 0:N.value,showHubSelectionPage:w==null?void 0:w.value}})},b=U({hubDisplayOrderModelOpen:i,handleHubDisplayOrderModelOpen:l,handleHubDisplayOrderModelClose:r});return(0,e.jsx)(v.lV,{className:"multi-hub-settings",fieldSets:[b],data:o,onChange:g,ref:d,footer:(0,e.jsx)(v.$n,{onClick:c,loading:h.isLoading||p.isLoading,children:"Save"})})};var W=n(483150);const X=()=>(0,e.jsx)(W.A,{titleNode:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("h4",{className:"header",children:"Multi Hub Settings"}),(0,e.jsx)("p",{className:"headerDescription",children:"Manage multi - hub settings and multi-hub selection page"})]}),actionNode:(0,e.jsx)(e.Fragment,{})}),Z=({title:t,description:u,actionComponent:i})=>(0,e.jsxs)("div",{className:"multi-hub-settings__row",children:[(0,e.jsxs)("div",{className:"multi-hub-settings__row--left",children:[(0,e.jsx)("h2",{className:"multi-hub-settings__row__title",children:t}),(0,e.jsx)("p",{children:u})]}),(0,e.jsx)("div",{className:"multi-hub-settings__row--right",children:i})]}),k=()=>{const t=(0,j.er)(),u=(0,f.useMemo)(()=>{var i,s,o,g;const{hubs:d,settings:{coreSettings:{hubSelectionPageSetting:h}}}=t;return{showHubSelectionPage:{value:(h==null?void 0:h.showHubSelectionPage)||!1},defaultHub:{value:(s=(i=a.A.find(d,{isDefault:!0}))==null?void 0:i.id)!=null?s:-1},featuredHub:{value:(g=(o=d==null?void 0:d.find(p=>p.isFeatured))==null?void 0:o.id)!=null?g:-1},hubSelectionPageAfterSignup:{value:(h==null?void 0:h.hubSelectionPageAfterSignup)||0},displayOrder:{value:a.A.map(d,p=>a.A.pick(p,["id","isDefault","isFeatured","displayOrder","isVisible"]))},hideHubs:{value:a.A.map(a.A.filter(d,{isVisible:!1}),"id")}}},[t]);return(0,e.jsxs)("div",{className:"layout",children:[(0,e.jsx)(X,{}),(0,e.jsx)(Q,{intialData:u})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.