forked from duneanalytics/DuneQueryRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path7664-18047e192f46e243.js.download
2 lines (2 loc) · 14 KB
/
7664-18047e192f46e243.js.download
1
2
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7664],{13717:function(e,n,t){"use strict";t.d(n,{Z:function(){return m}});var r=t(85893),i=t(69896),a=t.n(i),s=t(80949),l=t(24745),o=t(41664),d=t.n(o),c=t(71909),u=t(57831),h=t(1801),v=t(77747),x=t(42708),p=t(15468),f=t(15801);function m(e){let n=(0,u.kP)(),{enableFavoriting:t=!0}=e,i=(0,c.J)();return t?n?void 0===e.isFavorite?(0,r.jsx)("div",{className:a().favorites,children:(0,r.jsxs)(h.C,{size:"L",variant:"filled",color:"neutral",children:[(0,l.u)(e.stars),(0,r.jsx)(v.IconStar,{})]})}):(0,r.jsx)(g,{...e}):(0,r.jsx)("div",{className:a().favorites,children:(0,r.jsxs)(h.C,{size:"L",variant:"filled",color:"neutral",children:[(0,l.u)(e.stars),(0,r.jsx)(d(),{href:i,"aria-label":"Add to favorites",children:(0,r.jsx)(v.IconStar,{})})]})}):(0,r.jsxs)("div",{className:a().favorites,children:[(0,l.u)(e.stars),(0,r.jsx)(s.J,{icon:"person"})]})}function g(e){var n;let{favoriteDashboard:t}=(0,p.t)(),{unfavoriteDashboard:i}=(0,f.s)(),s=null!==(n=e.isFavorite)&&void 0!==n&&n;return s?(0,r.jsxs)("div",{className:a().favorites,children:[(0,l.u)(e.stars),(0,r.jsx)("button",{"aria-label":"Remove from favorites",onClick:()=>{i(e.dashboard_id)},children:(0,r.jsx)(x.IconStarFill,{})})]}):(0,r.jsxs)("div",{className:a().favorites,children:[(0,l.u)(e.stars),(0,r.jsx)("button",{"aria-label":"Add to favorites",onClick:()=>{t(e.dashboard_id)},children:(0,r.jsx)(v.IconStar,{})})]})}},24589:function(e,n,t){"use strict";t.d(n,{f:function(){return _}});var r=t(85893),i=t(69896),a=t.n(i),s=t(41664),l=t.n(s),o=t(71429),d=t(80949),c=t(13717),u=t(49955),h=t(56446);function v(e){let{dashboardSchedule:n,size:t}=e,i=n&&(0,h.mB)(n.cronString);return void 0===i||void 0===n?null:(0,r.jsx)(u.y,{size:t,schedule:n})}var x=t(30297),p=t(44914),f=t(93184),m=t(20834),g=t(27073),j=t(11941);let _=(0,j.X)(e=>{let{dashboard:n,origin:t,refetchFolderContent:i,trackResultClick:s}=e,u=(0,p.Kz)(n.owner),h=(0,g.iP)().width<699,j=(0,r.jsxs)("div",{className:a().nameAndTags,children:[(0,r.jsxs)(l(),{href:"/".concat(n.owner.handle,"/").concat(n.slug),className:a().contentName,onClick:s,onAuxClick:s,children:[n.name,n.isTrending&&(0,r.jsx)("span",{children:"\xa0\uD83D\uDD25"})]}),n.tags.length>0&&(0,r.jsx)(f.$,{className:a().tags,slug:"dashboards",tags:n.tags.slice(0,5)})]}),_="creations"===t?(0,r.jsx)(l(),{href:"/".concat(n.owner.handle,"/").concat(n.slug),children:(0,r.jsx)(d.J,{icon:"dashboard"})}):(0,r.jsx)(l(),{href:"/".concat(n.owner.handle),children:(0,r.jsx)(x.q,{src:n.owner.profile_image_url,ownerId:n.owner.id,handle:n.owner.handle,type:n.owner.type,size:h?16:25})}),b=(0,r.jsxs)("div",{className:a().rightContainer,children:[(0,r.jsx)("div",{className:a().badges,children:u&&(0,r.jsx)(v,{size:"L",dashboardSchedule:n.schedule})}),(0,r.jsxs)("div",{className:a().actions,children:[(0,r.jsx)(c.Z,{dashboard_id:n.id,stars:n.favoriteCount,isFavorite:n.hasStarred}),(0,r.jsx)(m.a,{contentItem:{type:"dashboard",id:n.id,owner:n.owner},refetchFolderContent:i})]})]});return h?(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:a().multiline,children:[j,(0,r.jsxs)("div",{className:a().ownerAndDetails,children:[_,(0,r.jsxs)(l(),{href:"/".concat(n.owner.handle),children:["@",n.owner.handle]})]}),(0,r.jsxs)("div",{className:a().ownerAndDetails,children:[(0,r.jsxs)("span",{children:["updated ",(0,r.jsx)(o.bM,{children:n.updated_at})]}),n.is_private&&(0,r.jsx)(d.J,{icon:"lock-fill"})]})]})}),(0,r.jsx)("td",{children:b})]}):(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:a().avatarColumn,children:_}),(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:a().multiline,children:[j,(0,r.jsxs)("div",{className:a().ownerAndDetails,children:[(0,r.jsx)(x.q,{src:n.owner.profile_image_url,ownerId:n.owner.id,handle:n.owner.handle,type:n.owner.type,size:20}),(0,r.jsxs)(l(),{href:"/".concat(n.owner.handle),children:["@",n.owner.handle]}),(0,r.jsxs)("span",{children:["• updated ",(0,r.jsx)(o.bM,{children:n.updated_at})]}),n.is_private&&(0,r.jsx)(d.J,{icon:"lock-fill"})]})]})}),(0,r.jsx)("td",{children:b})]})})},76441:function(e,n,t){"use strict";t.d(n,{x:function(){return c}});var r=t(85893),i=t(67294),a=t(94184),s=t.n(a),l=t(19324),o=t.n(l),d=t(80949);let c=e=>{var n;let t=null!==(n=e.as)&&void 0!==n?n:"div",a=s()(o().box,e.text&&o().text,e.icon&&o().icon,e.border&&o().border,e.light&&o().light,e.gray&&o().gray,e.color1&&o().color1,e.color2&&o().color2,e.size&&o()[e.size],e.className),l=(0,r.jsxs)(r.Fragment,{children:[e.title&&(0,r.jsx)("h2",{className:o().title,children:e.title}),e.icon&&(0,r.jsx)(d.J,{icon:e.icon,className:o().background}),(0,r.jsx)("div",{className:o().children,children:e.children})]}),c={className:a,role:e.role};return i.createElement(t,c,l)}},63668:function(e,n,t){"use strict";t.d(n,{Z:function(){return m},Y:function(){return f.Z}});var r=t(85893),i=t(94184),a=t.n(i),s=t(21249),l=t.n(s),o=t(80949);let d=e=>{let n=Math.ceil(e.page.count/e.page.page_size),t=e.page.page,i=a()(l().pagination,e.className),s=n>1&&t>1,o=n>1&&t<n;return(0,r.jsxs)("ul",{className:i,children:[s&&(0,r.jsx)("li",{className:l().item,children:e.children((0,r.jsx)(c,{}),t-1,!1)}),h(t,n).map((n,t)=>(0,r.jsx)("li",{className:l().item,children:"string"==typeof n?(0,r.jsx)("span",{children:n}):e.children(n,n,n===e.page.page)},"".concat(t,"-").concat(n))),o&&(0,r.jsx)("li",{className:l().item,children:e.children((0,r.jsx)(u,{}),t+1,!1)})]})},c=()=>(0,r.jsx)(o.J,{icon:"arrow-left","aria-label":"Previous"}),u=()=>(0,r.jsx)(o.J,{icon:"arrow-right","aria-label":"Next"}),h=(e,n)=>{let t=[e-1,e,e+1].filter(e=>e>1&&e<n),r=e===n-3,i=e<n-3;return n>1&&(4===e&&t.unshift(2),r&&t.push(n-1),e>4&&t.unshift("..."),i&&t.push("..."),t.unshift(1),t.push(n)),t};var v=t(41664),x=t.n(v);function p(e){let{page:n,getPageUrl:t,pageSize:i,totalCount:a}=e;return(0,r.jsx)(d,{page:{page:n,count:a,page_size:i,results:[]},children:(e,n,i)=>(0,r.jsx)(x(),{href:t(n),shallow:!0,"aria-current":i,children:e})})}var f=t(68583);function m(e){let[n,,t]=(0,f.Z)();return(0,r.jsx)(p,{page:n,getPageUrl:t,pageSize:e.pageSize,totalCount:e.totalCount})}},860:function(e,n,t){"use strict";t.d(n,{Z:function(){return o}});var r=t(85893),i=t(58048),a=t(41664),s=t.n(a),l=t(68583);function o(e){let{lastPage:n}=e,[t,,a]=(0,l.Z)(),o=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,r.jsxs)(i.H,{icon:"circle-fill",title:"Page out of bounds",children:[(0,r.jsx)("p",{children:o}),(0,r.jsx)("p",{children:(0,r.jsx)(s(),{href:a(1),children:"Go to page 1."})})]})}},58048:function(e,n,t){"use strict";t.d(n,{H:function(){return l}});var r=t(85893);t(67294);var i=t(49327),a=t.n(i),s=t(76441);let l=e=>(0,r.jsx)(s.x,{icon:e.icon,title:e.title,className:a().empty,color1:!0,text:!0,children:e.children})},47664:function(e,n,t){"use strict";t.d(n,{G:function(){return z}});var r=t(85893),i=t(31821),a=t(37242),s=t(32546),l=t(77251),o=t(41499),d=t(69896),c=t.n(d),u=t(82729),h=t(85361),v=t(57831),x=t(84937);function p(){let e=(0,u._)(["\n query ListSchedules(\n $filters: SchedulesFiltersInput!\n $pagination: LimitOffsetInput\n ) {\n schedules(filters: $filters, pagination: $pagination) {\n schedules {\n id\n userId\n teamId\n performance\n nextExecutionTime\n createdAt\n updatedAt\n dashboard {\n ...SDashboard\n }\n query {\n ...SQuery\n }\n }\n pageDetails {\n page\n total\n }\n }\n }\n \n fragment SDashboard on Dashboard {\n __typename\n createdAt\n updatedAt\n id\n isArchived\n isPrivate\n name\n slug\n starCount\n hasStarred\n tags\n team {\n id\n handle\n profileImageUrl\n }\n user {\n id\n handle: name\n profileImageUrl\n }\n schedules {\n id\n cronExpression\n performance\n nextExecutionTime\n ownedByCustomerId\n metadata {\n updatedAt\n }\n }\n }\n\n fragment SQuery on QueryModel {\n id\n name\n tags\n createdAt\n updatedAt\n isPrivate\n starCount\n hasStarred\n matviewId\n schedules {\n id\n cronExpression\n performance\n nextExecutionTime\n ownedByCustomerId\n metadata {\n updatedAt\n }\n }\n team {\n id\n handle\n profileImageUrl\n }\n user {\n id\n handle: name\n profileImageUrl\n }\n }\n"]);return p=function(){return e},e}(0,t(39137).Z)(p());var f=t(85533),m=t(24589),g=t(63668),j=t(62457),_=t(860),b=t(67294),y=t(7395),w=t(25675),N=t.n(w),I=t(42661);function S(){var e,n,t,i;let[a]=(0,g.Y)(),s=(0,b.useMemo)(()=>({page:a,pageSize:20}),[a]),l=function(e){var n,t;let{apiParams:r}=e,i=(0,h._0)(),a=(0,v.Ke)(),s=(0,x.MKK)({skip:void 0===i,context:{session:a},variables:{filters:{contextOwner:{id:null!==(n=null==i?void 0:i.id)&&void 0!==n?n:-1,type:null!==(t=null==i?void 0:i.type)&&void 0!==t?t:""}},pagination:{limit:r.pageSize,offset:r.pageSize*(r.page-1)}}});return s}({apiParams:s}),o=null===(e=l.data)||void 0===e?void 0:e.schedules.schedules,d=null!==(i=null!==(t=null===(n=l.data)||void 0===n?void 0:n.schedules.pageDetails.total)&&void 0!==t?t:null==o?void 0:o.length)&&void 0!==i?i:0,u=Math.max(1,Math.ceil(d/20));return a>u?(0,r.jsx)(_.Z,{lastPage:u}):void 0===o||(null==o?void 0:o.length)===0?(0,r.jsx)(y.u,{title:"You don't have any schedules yet.",description:"Create schedules to automatically run queries and dashboards at specific times.",illustration:(0,r.jsx)(N(),{alt:"",src:I.Z,width:190,height:200})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("table",{className:c().table,children:(0,r.jsx)("tbody",{children:o.map(e=>null!==e.query&&void 0!==e.query?(0,r.jsx)(f.G,{query:(0,j.sD)(e.query),origin:"creations"},e.query.id):null!==e.dashboard&&void 0!==e.dashboard?(0,r.jsx)(m.f,{dashboard:(0,j.Yb)(e.dashboard),origin:"creations"},e.dashboard.id):null)})}),(0,r.jsx)(g.Z,{pageSize:20,totalCount:d})]})}var C=t(41042),A=t(69339),D=t(18035),k=t(87257);function z(){let e=(0,A.L)();switch((0,C.e)(e.value,{getUrl:e=>(0,D.Y)(e)+"/schedules"}),e.status){case"LOADING":return(0,r.jsx)(a.h,{});case"INVALID":return(0,r.jsx)(k.C,{urlContext:e.invalidValue})}let n=(0,r.jsx)(o.E,{activePage:"Schedules"});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.yG,{title:"Schedules"}),(0,r.jsxs)(s.T3,{children:[(0,r.jsx)(s.h4,{renderLibraryMobileMenu:()=>n}),(0,r.jsxs)(s.or,{children:[(0,r.jsx)(l.im,{children:n}),(0,r.jsx)(s.JH,{children:(0,r.jsx)(s.Kb,{children:(0,r.jsx)(S,{})})})]})]})]})}},62457:function(e,n,t){"use strict";t.d(n,{F6:function(){return d},Yb:function(){return o},sD:function(){return l}});var r=t(61575),i=t(83267),a=t(84512),s=t(35560);function l(e){var n,t,i,a,s,l,o,c,u;let h=void 0!==e.user&&null!==e.user?{type:"user",handle:e.user.handle,id:e.user.id,profile_image_url:null!==(a=e.user.profileImageUrl)&&void 0!==a?a:void 0}:{type:"team",handle:null!==(s=null===(n=e.team)||void 0===n?void 0:n.handle)&&void 0!==s?s:"",id:null!==(l=null===(t=e.team)||void 0===t?void 0:t.id)&&void 0!==l?l:-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:h,is_private:e.isPrivate,tags:null!==(c=e.tags)&&void 0!==c?c:[],favoriteCount:e.starCount,matview_id:null!==(u=e.matviewId)&&void 0!==u?u:void 0,hasStarred:e.hasStarred,schedule:(0,r.$K)(e.schedules)?d(e.schedules[0]):void 0}}function o(e){var n,t,i,a,s,l,o,c;let u=void 0!==e.user&&null!==e.user?{type:"user",handle:e.user.handle,id:e.user.id,profile_image_url:null!==(a=e.user.profileImageUrl)&&void 0!==a?a:void 0}:{type:"team",handle:null!==(s=null===(n=e.team)||void 0===n?void 0:n.handle)&&void 0!==s?s:"",id:null!==(l=null===(t=e.team)||void 0===t?void 0:t.id)&&void 0!==l?l:-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,slug:e.slug,isTrending:!1,created_at:e.createdAt,updated_at:e.updatedAt,owner:u,is_private:e.isPrivate,tags:null!==(c=e.tags)&&void 0!==c?c:[],favoriteCount:e.starCount,hasStarred:e.hasStarred,schedule:(0,r.$K)(e.schedules)?d(e.schedules[0]):void 0}}function d(e){return void 0!==e&&(0,r.$K)(e.cronExpression)&&(0,a.fN)(e.cronExpression)&&(0,r.$K)(e.performance)&&(0,s.U)(e.performance)&&(0,r.$K)(e.ownedByCustomerId)?{id:e.id,cronString:e.cronExpression,performanceTier:e.performance,owner:i.Qc(e.ownedByCustomerId),updatedAt:e.metadata.updatedAt}:void 0}},15468:function(e,n,t){"use strict";t.d(n,{t:function(){return l}});var r=t(82729),i=t(57831),a=t(84937);function s(){let e=(0,r._)(["\n mutation FavoriteDashboard($input: FavoriteDashboardInput!) {\n favoriteDashboard(input: $input) {\n id\n starCount\n hasStarred\n }\n }\n"]);return s=function(){return e},e}function l(){let e=(0,i.kP)(),[n,t]=(0,a.QyX)();return{favoriteDashboard:function(t){n({context:{session:e},variables:{input:{id:t}}})},favoriteDashboardMutationResult:t}}(0,t(39137).Z)(s())},15801:function(e,n,t){"use strict";t.d(n,{s:function(){return l}});var r=t(82729),i=t(57831),a=t(84937);function s(){let e=(0,r._)(["\n mutation UnfavoriteDashboard($input: UnfavoriteDashboardInput!) {\n unfavoriteDashboard(input: $input) {\n id\n starCount\n hasStarred\n }\n }\n"]);return s=function(){return e},e}function l(){let e=(0,i.kP)(),[n,t]=(0,a.LhV)();return{unfavoriteDashboard:function(t){n({context:{session:e},variables:{input:{id:t}}})},unfavoriteDashboardMutationResult:t}}(0,t(39137).Z)(s())},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"}}}]);
//# sourceMappingURL=7664-18047e192f46e243.js.map