forked from duneanalytics/DuneQueryRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
alerts-793a92e51e99855a.js.download
2 lines (2 loc) · 7.47 KB
/
alerts-793a92e51e99855a.js.download
1
2
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1788],{15965:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/workspace/u/[handle]/library/alerts",function(){return t(10743)}])},76441:function(e,n,t){"use strict";t.d(n,{x:function(){return c}});var i=t(85893),r=t(67294),l=t(94184),a=t.n(l),o=t(19324),s=t.n(o),u=t(80949);let c=e=>{var n;let t=null!==(n=e.as)&&void 0!==n?n:"div",l=a()(s().box,e.text&&s().text,e.icon&&s().icon,e.border&&s().border,e.light&&s().light,e.gray&&s().gray,e.color1&&s().color1,e.color2&&s().color2,e.size&&s()[e.size],e.className),o=(0,i.jsxs)(i.Fragment,{children:[e.title&&(0,i.jsx)("h2",{className:s().title,children:e.title}),e.icon&&(0,i.jsx)(u.J,{icon:e.icon,className:s().background}),(0,i.jsx)("div",{className:s().children,children:e.children})]}),c={className:l,role:e.role};return r.createElement(t,c,o)}},63668:function(e,n,t){"use strict";t.d(n,{Z:function(){return v},Y:function(){return x.Z}});var i=t(85893),r=t(94184),l=t.n(r),a=t(21249),o=t.n(a),s=t(80949);let u=e=>{let n=Math.ceil(e.page.count/e.page.page_size),t=e.page.page,r=l()(o().pagination,e.className),a=n>1&&t>1,s=n>1&&t<n;return(0,i.jsxs)("ul",{className:r,children:[a&&(0,i.jsx)("li",{className:o().item,children:e.children((0,i.jsx)(c,{}),t-1,!1)}),p(t,n).map((n,t)=>(0,i.jsx)("li",{className:o().item,children:"string"==typeof n?(0,i.jsx)("span",{children:n}):e.children(n,n,n===e.page.page)},"".concat(t,"-").concat(n))),s&&(0,i.jsx)("li",{className:o().item,children:e.children((0,i.jsx)(d,{}),t+1,!1)})]})},c=()=>(0,i.jsx)(s.J,{icon:"arrow-left","aria-label":"Previous"}),d=()=>(0,i.jsx)(s.J,{icon:"arrow-right","aria-label":"Next"}),p=(e,n)=>{let t=[e-1,e,e+1].filter(e=>e>1&&e<n),i=e===n-3,r=e<n-3;return n>1&&(4===e&&t.unshift(2),i&&t.push(n-1),e>4&&t.unshift("..."),r&&t.push("..."),t.unshift(1),t.push(n)),t};var h=t(41664),_=t.n(h);function g(e){let{page:n,getPageUrl:t,pageSize:r,totalCount:l}=e;return(0,i.jsx)(u,{page:{page:n,count:l,page_size:r,results:[]},children:(e,n,r)=>(0,i.jsx)(_(),{href:t(n),shallow:!0,"aria-current":r,children:e})})}var x=t(68583);function v(e){let[n,,t]=(0,x.Z)();return(0,i.jsx)(g,{page:n,getPageUrl:t,pageSize:e.pageSize,totalCount:e.totalCount})}},860:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var i=t(85893),r=t(58048),l=t(41664),a=t.n(l),o=t(68583);function s(e){let{lastPage:n}=e,[t,,l]=(0,o.Z)(),s=1===n?"You are on page ".concat(t,", but there is only one page of results."):"You are on page ".concat(t,", but there are only ").concat(n," pages of results.");return(0,i.jsxs)(r.H,{icon:"circle-fill",title:"Page out of bounds",children:[(0,i.jsx)("p",{children:s}),(0,i.jsx)("p",{children:(0,i.jsx)(a(),{href:l(1),children:"Go to page 1."})})]})}},58048:function(e,n,t){"use strict";t.d(n,{H:function(){return o}});var i=t(85893);t(67294);var r=t(49327),l=t.n(r),a=t(76441);let o=e=>(0,i.jsx)(a.x,{icon:e.icon,title:e.title,className:l().empty,color1:!0,text:!0,children:e.children})},21227:function(e,n,t){"use strict";t.d(n,{p:function(){return C}});var i=t(85893),r=t(31821),l=t(37242),a=t(32546),o=t(77251),s=t(41499),u=t(67294),c=t(69896),d=t.n(c),p=t(68583),h=t(82729),_=t(85361),g=t(57831),x=t(84937);function v(){let e=(0,h._)(["\n query ListQueryAlerts(\n $filters: ListQueryAlertsFiltersInput!\n $pagination: LimitOffsetInput\n ) {\n listQueryAlerts(filters: $filters, pagination: $pagination) {\n queryAlerts {\n email {\n id\n emails\n }\n webhook {\n id\n url\n dataFieldName\n httpHeaders\n jsonPayloadFields\n }\n slack {\n id\n url\n }\n discord {\n id\n url\n }\n queryId\n query {\n ...AQuery\n }\n }\n pageDetails {\n page\n total\n }\n }\n }\n \n fragment AQuery on QueryModel {\n id\n name\n tags\n createdAt\n updatedAt\n isPrivate\n starCount\n hasStarred\n matviewId\n team {\n id\n handle\n profileImageUrl\n }\n user {\n id\n handle: name\n profileImageUrl\n }\n }\n"]);return v=function(){return e},e}(0,t(39137).Z)(v());var f=t(860),m=t(85533),j=t(63668),b=t(7395),y=t(25675),N=t.n(y),w=t(42661);function A(){var e,n,t;let[r]=(0,p.Z)(),l=(0,u.useMemo)(()=>({page:r,pageSize:20}),[r]),a=function(e){var n,t;let{apiParams:i}=e,r=(0,_._0)(),l=(0,g.Ke)(),a=(0,x.plk)({skip:void 0===r,context:{session:l},variables:{filters:{contextOwner:{id:null!==(n=null==r?void 0:r.id)&&void 0!==n?n:-1,type:null!==(t=null==r?void 0:r.type)&&void 0!==t?t:""}},pagination:{limit:i.pageSize,offset:i.pageSize*(i.page-1)}}});return a}({apiParams:l}),o=null===(e=a.data)||void 0===e?void 0:e.listQueryAlerts.queryAlerts,s=null!==(t=null===(n=a.data)||void 0===n?void 0:n.listQueryAlerts.pageDetails.total)&&void 0!==t?t:0,c=Math.max(1,Math.ceil(s/20));return r>c?(0,i.jsx)(f.Z,{lastPage:c}):void 0===o||(null==o?void 0:o.length)===0?(0,i.jsx)(b.u,{title:"You don't have any alerts yet.",description:"Create alerts to receive the output of scheduled queries via email or webhooks, including Slack and Discord.",illustration:(0,i.jsx)(N(),{alt:"",src:w.Z,width:190,height:200})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("table",{className:d().table,children:(0,i.jsx)("tbody",{children:o.map(e=>(0,i.jsx)(m.G,{query:function(e){var n,t,i,r,l,a,o,s,u;let c=void 0!==e.user&&null!==e.user?{type:"user",handle:e.user.handle,id:e.user.id,profile_image_url:null!==(r=e.user.profileImageUrl)&&void 0!==r?r:void 0}:{type:"team",handle:null!==(l=null===(n=e.team)||void 0===n?void 0:n.handle)&&void 0!==l?l:"",id:null!==(a=null===(t=e.team)||void 0===t?void 0:t.id)&&void 0!==a?a:-1,profile_image_url:null!==(o=null===(i=e.team)||void 0===i?void 0:i.profileImageUrl)&&void 0!==o?o:void 0};return{id:e.id,name:e.name,created_at:e.createdAt,updated_at:e.updatedAt,owner:c,is_private:e.isPrivate,tags:null!==(s=e.tags)&&void 0!==s?s:[],favoriteCount:e.starCount,hasStarred:e.hasStarred,matview_id:null!==(u=e.matviewId)&&void 0!==u?u:void 0}}(e.query),origin:"creations"},e.query.id))})}),(0,i.jsx)(j.Z,{pageSize:20,totalCount:s})]})}var k=t(41042),I=t(69339),z=t(18035),S=t(87257);function C(){let e=(0,I.L)();switch((0,k.e)(e.value,{getUrl:e=>(0,z.Y)(e)+"/alerts"}),e.status){case"LOADING":return(0,i.jsx)(l.h,{});case"INVALID":return(0,i.jsx)(S.C,{urlContext:e.invalidValue})}let n=(0,i.jsx)(s.E,{activePage:"Alerts"});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.yG,{title:"Alerts"}),(0,i.jsxs)(a.T3,{children:[(0,i.jsx)(a.h4,{renderLibraryMobileMenu:()=>n}),(0,i.jsxs)(a.or,{children:[(0,i.jsx)(o.im,{children:n}),(0,i.jsx)(a.JH,{children:(0,i.jsx)(a.Kb,{children:(0,i.jsx)(A,{})})})]})]})]})}},10743:function(e,n,t){"use strict";t.r(n);var i=t(36986),r=t(21227);n.default=(0,i.c)(r.p)},19324:function(e){e.exports={box:"box_box__Sp1NE",sm:"box_sm__gjJx_",light:"box_light__yi_Hy",gray:"box_gray__BsM_v",color1:"box_color1__Qd3DT",color2:"box_color2__LzrkO",border:"box_border__8lw0M",icon:"box_icon__lpuSM",background:"box_background__dz8td",title:"box_title__8Ygrc",text:"box_text__kKNnI",children:"box_children__8bH71"}},49327:function(e){e.exports={empty:"empty_empty__jXF_3"}},21249:function(e){e.exports={pagination:"pagination_pagination__QiI6B",item:"pagination_item__PAJVt"}}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[9225,3318,8110,3295,777,6746,5675,1444,9002,9938,9694,4974,819,1532,4465,9774,2888,179],function(){return n(73611),n(15965)}),_N_E=e.O()}]);
//# sourceMappingURL=alerts-793a92e51e99855a.js.map