PageSourceSearch

https://www.govolunteerglos.org/assets/triggers-Bj3ReGHk.js

js govolunteerglos.org collected 2026-10-08 04:11:36 UTC 4,545 bytes, 2 lines download raw bytes

1import{V as k,u as w,j as e,F as q,L as c,X as D,B as n,y as F,z as O,t as R,e as z,_ as A,Z as _,T as E,bi as M,fI as L,bR as l,bF as U,c_ as W,a$ as B}from"./index-CLautiso.js";import{r as p}from"./vendor-BFrzAml_.js";import{W as y}from"./WYSIWYG-BTyR3JWX.js";import{r as f}from"./admin-DiBl7ag1.js";import"./app-0SgohmKS.js";import"./dayjs-timezone-iana-plugin-B-UFEDqf.js";try{let a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new a.Error().stack;s&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[s]="0f118974-a788-449d-b04d-b67fd0e4a781",a._sentryDebugIdIdentifier="sentry-dbid-0f118974-a788-449d-b04d-b67fd0e4a781")}catch{}const Y=200,P=({onSubmit:a,initialValues:s,onChange:o,showButton:m=!0})=>{const d=k(),i=w({onSubmit:a,initialValues:s,onChange:o});return e.jsxs(q,{form:i,children:["Will be sent from WL default email address. You can use %first_names% anywhere and %orgname%",e.jsx(c,{label:"Subject",required:!0,children:e.jsx(D,{...i.binding("subject"),maxLength:Y,required:!0})}),e.jsx(c,{label:"Above button text",required:!0,children:e.jsx(y,{target_id:d.organization_id,target_type:"organization",mode:"email",...i.binding("above_button_text_html"),required:!0})}),e.jsx(c,{label:"Button Text",required:!0,children:e.jsx(D,{...i.binding("button_text"),maxLength:Y,required:!0})}),e.jsx(c,{label:"Below button text",required:!0,children:e.jsx(y,{target_id:d.organization_id,target_type:"organization",mode:"email",...i.binding("below_button_text_html"),required:!0})}),m&&e.jsx(n,{type:"submit",loading:i.submitting,mt:"md",children:"Send"})]})},Z=a=>{const s=F(),o=O(),[m,d]=p.useState(!1),[i,b]=p.useState(!1),C=R.users.remove.useMutation(),[v,x]=p.useState(!1),h=z(),u=t=>g=>{window.confirm(`Are you sure you want to run trigger ${t}`)&&h(f({command:t,data:g})).then(s(),o())},j=()=>u("wipeUnclaimedFromMigration")(r.values),r=w({onSubmit:j}),S=t=>{h(f({command:"sendClaimOrgReminder",data:t})).then(s(),o())},I=()=>{x(!0),h(f({command:"snapshotData"})).then(t=>{x(!1),s()(t)},o())},T=()=>{const t=W.coerce.number().int().positive().safeParse(window.prompt("Whats the user id you want to delete?"));t.success?C.mutateAsync({userId:t.data}).then(s()).catch(o()):B.error({message:"Invalid user id"})};return e.jsxs(A,{p:"md",children:[e.jsxs(_,{gap:"sm",children:[e.jsx(E,{order:5,children:"Triggers"}),e.jsxs(_,{gap:"xs",align:"flex-start",children:[e.jsx(n,{size:"sm",variant:"outline",onClick:T,children:"Delete User"}),e.jsx(n,{variant:"outline",onClick:()=>u("refreshMailchimp")(),children:"MailChimp: Refresh contacts"}),e.jsx(n,{variant:"outline",onClick:()=>u("drainContactsSyncQueue")(),children:"Contacts: Drain Sync Queue"}),e.jsx(n,{variant:"outline",onClick:()=>u("addMailchimpFields")(),children:"MailChimp: Add fields"}),e.jsx(n,{variant:"outline",onClick:()=>u("addLaPostaFields")(),children:"La Posta: Add fields"}),e.jsx(n,{variant:"outline",onClick:()=>d(!0),children:"Send a custom email to unclaimed orgs on this whitelabel."}),e.jsx(n,{variant:"outline",onClick:()=>b(!0),children:"Open modal for deleting unclaimed users and organizations"}),e.jsx(n,{variant:"outline",onClick:()=>I(),loading:v,children:"Snapshot data"})]})]}),m&&e.jsx(M,{onClose:()=>d(!1),open:m,children:e.jsx(P,{onSubmit:S,initialValues:{}})}),i&&e.jsxs(M,{onClose:()=>b(!1),open:i,children:["Delete all unclaimed migrated users and organisations that have no claimed admins/moderators that registered between the specified dates. Watch out for timezone differences, give it some buffer time.",e.jsx(L,{type:"range",allowSingleDateInRange:!0,defaultDate:new Date,minDate:l(new Date(2018,0)).format("YYYY-MM-DD"),maxDate:l().format("YYYY-MM-DD"),value:[r.values.date_starting?l(r.values.date_starting).format("YYYY-MM-DD"):null,r.values.date_ending?l(r.values.date_ending).format("YYYY-MM-DD"):null],onChange:([t,g])=>{r.binding("date_starting").onChange(t?l(t,"YYYY-MM-DD").startOf("day").toISOString():null),r.binding("date_ending").onChange(g?l(g,"YYYY-MM-DD").endOf("day").toISOString():null)}}),e.jsx(c,{label:"Users total limit",help:"Max number of users to cleanup at once. Might be needed if the migration was so large the trigger times out. (0 
1= no limit)",children:e.jsx(U,{min:0,max:99999,step:1,...r.binding("limit")})}),e.jsx(n,{size:"sm",variant:"outline",style:{display:"block",marginTop:"10px"},onClick:()=>j(),children:"Delete unclaimed users and organizations"})]})]})};export{Z as default};
2//# sourceMappingURL=triggers-Bj3ReGHk.js.map

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.