PageSourceSearch

https://portal.startzion.com/build/assets/SyncFieldsToTenantModal-R5wif7en.js

js startzion.com collected 2026-10-05 23:10:05 UTC 3,167 bytes, 1 lines download raw bytes

1import{r as p,j as e,c as k}from"./app-og3UcCOq.js";import{B as h}from"./react-toastify.esm-CqWJ5ynP.js";import{M as o}from"./Modal-226cgUlx.js";import{F as a}from"./Form-DXkSD0ru.js";import"./ThemeProvider-XXxKa9H6.js";import"./listen-DOhMskc_.js";import"./useCallbackRef-CN7XmZF4.js";import"./useEventCallback-Co4Qhe_M.js";import"./useMergedRefs-Df2MWX4p.js";import"./useWillUnmount-jfyJ8na6.js";import"./TransitionWrapper-R9Qq9DSf.js";import"./Transition-DP5N--C6.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./setPrototypeOf-DgZC2w_0.js";import"./AbstractModalHeader-DvYtqNJs.js";import"./useWindow-BUkqYofp.js";import"./useMounted-CXXHI717.js";import"./usePrevious-C0XVXT_4.js";import"./ImperativeTransition-oNlr0R4e.js";import"./NoopTransition-BoRmH6Wq.js";import"./Fade-D16tu4pN.js";import"./removeClass-loOrDRrx.js";import"./hasClass-D5ZjVvBY.js";import"./querySelectorAll-Cwpyv69p.js";import"./DataKey-DjdvojM5.js";import"./CloseButton-D361Dxa_.js";import"./index-B3ZnK1RF.js";import"./divWithClassName-BIVfRb28.js";import"./ElementChildren-C4b93nt5.js";import"./Col-r5uuNBwP.js";const Y=({labPanelId:d,show:u,toggleModal:n})=>{if(!d)return null;const[f,m]=p.useState(!1),i=[{field:"name",label:"Name",checked:!0},{field:"description",label:"Description",checked:!0},{field:"cost_to_client_tier1",label:"Tier 1 Cost to Client",checked:!0},{field:"cost_to_client_tier2",label:"Tier 2 Cost to Client",checked:!0}],x=i.filter(t=>t.checked),[l,c]=p.useState(new Set(x.map(t=>t.field))),b=t=>{c(s=>{const r=new Set(s);return r.has(t)?r.delete(t):r.add(t),r})},j=t=>{t.target.checked?c(new Set(i.map(s=>s.field))):c(new Set)},y=async t=>{if(t.preventDefault(),l.size===0){h.error("Please select at least one field to sync.",{position:"top-right"});return}try{m(!0);const s=Array.from(l);await k.post(`/lab-panels/sync-to-tenant/${d}`,{fields:s}),h.success("Selected fields will be synced to tenants.",{position:"top-right"}),n()}catch(s){alert(s)}finally{m(!1)}};return e.jsx(e.Fragment,{children:e.jsxs(o,{show:u,onHide:n,centered:!0,size:"lg",children:[e.jsx(o.Header,{closeButton:!0,children:e.jsx("h5",{className:"modal-title",children:"Sync Fields To Tenants"})}),e.jsxs(a,{onSubmit:y,children:[e.jsxs(o.Body,{children:[e.jsxs("p",{className:"text-muted",children:["Selected fields values will be synchronized to all the tenants that have this Lab panel added.",e.jsx("br",{}),e.jsx("span",{className:"fs-12",children:"Please make sure to save changes you made on fields before using this functionality."})]}),e.jsxs("div",{className:"my-3",children:[e.jsx(a.Check,{id:"select-all-sync-fs",type:"checkbox",label:"Select/Unselect All Fields",checked:l.size===i.length,onChange:j}),e.jsx("hr",{className:"mt-2"})]}),e.jsx("div",{className:"row",children:i.map(({field:t,label:s})=>e.jsx("div",{className:"col-md-4",children:e.jsx(a.Check,{id:`field-${t}`,label:s,checked:l.has(t),onChange:()=>b(t)})},t))})]}),e.jsxs(o.Footer,{children:[e.jsx("button",{type:"button",className:"btn btn-light",onClick:n,children:"Cancel"}),e.jsx("button",{type:"submit",className:"btn btn-primary",disabled:f,children:"Sync"})]})]})]})})};export{Y as default};

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.