PageSourceSearch

https://app.hightouch.com/assets/default-notification-overrides-Bng7boro.js

js hightouch.com collected 2026-09-24 07:24:55 UTC 4,975 bytes, 2 lines download raw bytes

1import{ae as H,af as e}from"./vendor-B2oIjyY4.js";import{b as P,c as W,M as d,d as z,D as E,B as l,e as Q,C as c,R as r,f as o,g as p,I as h,T as V,h as Y,i as k,j as $,H as q,k as F,l as G,m as J,O as K,n as U,o as C,P as X}from"./main-CJK8sxkW.js";import{S as M}from"./subscribed-resource-item-Bd9JJQca.js";import"./bounded-range-fetch-CggGfMWc.js";import"./vendor-charts-BqgCVUWx.js";import"./channel-definitions-CAQfU9hm.js";import"./pagerduty-DBz7_rKy.js";import"./slack-Dw3cJhzM.js";import"./index-BUm8Tmbz.js";import"./isURL-1hkCZYbi.js";import"./index-BU6gJ6Wi.js";import"./utils-CDaiNJbe.js";const pe=()=>{var g,f,w;const[O]=H(),m=P(),x=O.get("parentResourceId"),{data:i,isLoading:T,isRefetching:B,refetch:D}=W({parentResourceId:x??"",parentResourceIdBigint:x??"",parentResourceType:X.Destination,childResourceType:d.Sync},{enabled:!!x}),{mutateAsync:u}=z(),s=i==null?void 0:i.destinations_by_pk,j=()=>{m(-1)},A=((g=i==null?void 0:i.destinations_by_pk)==null?void 0:g.syncs.flatMap(n=>{var _,b,v,I,R,S;const a=i.resource_notification_channels.filter(t=>t.resource_id===n.id.toString()&&t.resource_type===d.Sync).map(t=>({...t.workspace_notification_channel,disabled:t.disabled})),L=i.notification_channel_templates.filter(t=>!a.find(N=>N.id===t.workspace_notification_channel.id)).map(t=>({...t.workspace_notification_channel,disabled:t.disabled})),y=[...a,...L];return y.length>0?[{id:n.id,overrides:y,connection:{icon:(b=(_=n.segment)==null?void 0:_.connection)==null?void 0:b.definition.icon,name:((v=n.segment)==null?void 0:v.name)??((S=(R=(I=n.segment)==null?void 0:I.connection)==null?void 0:R.definition)==null?void 0:S.name)}}]:[]}))||[];return e.jsx(E,{isOpen:!0,onClose:j,actions:e.jsx(k,{onClick:j,variant:"primary",children:"Done"}),variant:"info",title:"Alerting Overrides",width:"4xl",children:e.jsx(l,{children:T||!s?e.jsx(Q,{isLoading:!0,children:e.jsxs(c,{gap:2,children:[e.jsxs(r,{gap:2,alignContent:"start",p:2,children:[e.jsx(o,{width:"24px",height:"24px",borderRadius:"full"}),e.jsxs(c,{gap:1,children:[e.jsx(o,{height:"20px",width:"180px"}),e.jsx(o,{height:"16px",width:"120px"})]})]}),e.jsx(o,{height:"20px",width:"100%",borderRadius:"md"}),e.jsx(o,{height:"20px",width:"100%",borderRadius:"md"}),e.jsx(o,{height:"20px",width:"100%",borderRadius:"md"})]})}):e.jsxs(c,{gap:8,children:[e.jsxs(r,{gap:14,w:"100%",children:[e.jsxs(c,{gap:2,children:[e.jsx(r,{children:e.jsx(p,{children:"Resource"})}),e.jsxs(r,{alignItems:"center",gap:2,children:[e.jsx(h,{src:(f=s==null?void 0:s.definition)==null?void 0:f.icon,name:(s==null?void 0:s.name)||((w=s==null?void 0:s.definition)==null?void 0:w.name)}),e.jsx(c,{children:e.jsxs(V,{children:["Syncs to “",s==null?void 0:s.name,"”"]})})]})]}),e.jsxs(c,{gap:2,children:[e.jsx(r,{children:e.jsx(p,{children:"Default Alert Recipients"})}),e.jsx(r,{alignItems:"center",gap:2,children:e.jsx(l,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:2,children:(i==null?void 0:i.notification_channel_templates.length)>0?i==null?void 0:i.notification_channel_templates.map(n=>e.jsx(M,{channel:n.workspace_notification_channel},n.workspace_notification_channel.id)):"None"})})]})]}),e.jsxs(c,{gap:4,children:[e.jsxs(r,{justifyContent:"space-between",w:"100%",children:[e.jsx(Y,{children:"Overridden syncs"}),e.jsx(k,{size:"sm",isLoading:B,onClick:async()=>{var n;await u({resourceIds:((n=i==null?void 0:i.destinations_by_pk)==null?void 0:n.syncs.map(a=>a.id.toString()))??[],resourceType:d.Sync}),await D()},variant:"danger",children:"Clear all overrides"})]}),e.jsxs(l,{children:[e.jsx($,{data:A,columns:[{whitespace:"unset",header:()=>e.jsx(p,{children:"Sync"}),max:"180px",cell:n=>e.jsxs(r,{gap:2,alignItems:"center",w:"200px",children:[e.jsx(h,{src:n.connection.icon,name:n.connection.name}),n.connection.name]})},{max:"50px",cell:()=>e.jsx(r,{w:"100%",justifyContent:"center",children:e.jsx(q,{size:"lg",color:"text.tertiary",children:e.jsx(F,{})})})},{whitespace:"unset",max:"180px",cell:()=>e.jsxs(r,{gap:2,alignItems:"center",w:"200px",children:[e.jsx(h,{src:s.definition.icon,name:s.name||s.definition.name}),s.name]})},{header:()=>e.jsx(p,{children:"Added recipients"}),whitespace:"unset",cellSx:{paddingY:2,"&:last-of-type":{borderBottom:"none"}},cell:n=>e.jsx(r,{gap:2,display:"flex",flexWrap:"wrap",children:n.overrides.map(a=>a.disabled?null:e.jsx(l,{display:"inline-block",children:e.jsx(M,{channel:a})},a.id))})},{max:"60px",cell:n=>e.jsx(r,{display:"flex",flexDir:"column",alignItems:"end",w:"100%",children:e.jsxs(G,{children:[e.jsx(J,{icon:K,"aria-label":"open-sync-overrides-option"}),e.jsxs(U,{children:[e.jsx(C,{onClick:()=>m(`/syncs/${n.id}`),children:"View Sync"}),e.jsx(C,{onClick:()=>u({resourceIds:[n.id.toString()],resourceType:d.Sync}),children:"Clear overrides"})]})]})})}]}
1),e.jsx(l,{background:"white",mt:"-1px",w:"100%",h:"0.5px",position:"relative"})]})]})]})})})};export{pe as SyncNotificationOverrides};
2//# sourceMappingURL=default-notification-overrides-Bng7boro.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.