forked from bombastictranz/DuneQueryRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1161-a3ae0bd0adcf8c0e.js.download
2 lines (2 loc) · 15.3 KB
/
1161-a3ae0bd0adcf8c0e.js.download
1
2
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1161],{13717:function(e,t,n){n.d(t,{Z:function(){return g}});var r=n(85893),i=n(69896),a=n.n(i),o=n(80949),s=n(24745),d=n(41664),l=n.n(d),u=n(71909),c=n(57831),h=n(1801),v=n(77747),f=n(42708),p=n(15468),m=n(15801);function g(e){let t=(0,c.kP)(),{enableFavoriting:n=!0}=e,i=(0,u.J)();return n?t?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,s.u)(e.stars),(0,r.jsx)(v.IconStar,{})]})}):(0,r.jsx)(b,{...e}):(0,r.jsx)("div",{className:a().favorites,children:(0,r.jsxs)(h.C,{size:"L",variant:"filled",color:"neutral",children:[(0,s.u)(e.stars),(0,r.jsx)(l(),{href:i,"aria-label":"Add to favorites",children:(0,r.jsx)(v.IconStar,{})})]})}):(0,r.jsxs)("div",{className:a().favorites,children:[(0,s.u)(e.stars),(0,r.jsx)(o.J,{icon:"person"})]})}function b(e){var t;let{favoriteDashboard:n}=(0,p.t)(),{unfavoriteDashboard:i}=(0,m.s)(),o=null!==(t=e.isFavorite)&&void 0!==t&&t;return o?(0,r.jsxs)("div",{className:a().favorites,children:[(0,s.u)(e.stars),(0,r.jsx)("button",{"aria-label":"Remove from favorites",onClick:()=>{i(e.dashboard_id)},children:(0,r.jsx)(f.IconStarFill,{})})]}):(0,r.jsxs)("div",{className:a().favorites,children:[(0,s.u)(e.stars),(0,r.jsx)("button",{"aria-label":"Add to favorites",onClick:()=>{n(e.dashboard_id)},children:(0,r.jsx)(v.IconStar,{})})]})}},24589:function(e,t,n){n.d(t,{f:function(){return y}});var r=n(85893),i=n(69896),a=n.n(i),o=n(41664),s=n.n(o),d=n(71429),l=n(80949),u=n(13717),c=n(49955),h=n(56446);function v(e){let{dashboardSchedule:t,size:n}=e,i=t&&(0,h.mB)(t.cronString);return void 0===i||void 0===t?null:(0,r.jsx)(c.y,{size:n,schedule:t})}var f=n(30297),p=n(44914),m=n(93184),g=n(20834),b=n(27073),x=n(11941);let y=(0,x.X)(e=>{let{dashboard:t,origin:n,refetchFolderContent:i,trackResultClick:o}=e,c=(0,p.Kz)(t.owner),h=(0,b.iP)().width<699,x=(0,r.jsxs)("div",{className:a().nameAndTags,children:[(0,r.jsxs)(s(),{href:"/".concat(t.owner.handle,"/").concat(t.slug),className:a().contentName,onClick:o,onAuxClick:o,children:[t.name,t.isTrending&&(0,r.jsx)("span",{children:"\xa0\uD83D\uDD25"})]}),t.tags.length>0&&(0,r.jsx)(m.$,{className:a().tags,slug:"dashboards",tags:t.tags.slice(0,5)})]}),y="creations"===n?(0,r.jsx)(s(),{href:"/".concat(t.owner.handle,"/").concat(t.slug),children:(0,r.jsx)(l.J,{icon:"dashboard"})}):(0,r.jsx)(s(),{href:"/".concat(t.owner.handle),children:(0,r.jsx)(f.q,{src:t.owner.profile_image_url,ownerId:t.owner.id,handle:t.owner.handle,type:t.owner.type,size:h?16:25})}),w=(0,r.jsxs)("div",{className:a().rightContainer,children:[(0,r.jsx)("div",{className:a().badges,children:c&&(0,r.jsx)(v,{size:"L",dashboardSchedule:t.schedule})}),(0,r.jsxs)("div",{className:a().actions,children:[(0,r.jsx)(u.Z,{dashboard_id:t.id,stars:t.favoriteCount,isFavorite:t.hasStarred}),(0,r.jsx)(g.a,{contentItem:{type:"dashboard",id:t.id,owner:t.owner},refetchFolderContent:i})]})]});return h?(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:a().multiline,children:[x,(0,r.jsxs)("div",{className:a().ownerAndDetails,children:[y,(0,r.jsxs)(s(),{href:"/".concat(t.owner.handle),children:["@",t.owner.handle]})]}),(0,r.jsxs)("div",{className:a().ownerAndDetails,children:[(0,r.jsxs)("span",{children:["updated ",(0,r.jsx)(d.bM,{children:t.updated_at})]}),t.is_private&&(0,r.jsx)(l.J,{icon:"lock-fill"})]})]})}),(0,r.jsx)("td",{children:w})]}):(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:a().avatarColumn,children:y}),(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:a().multiline,children:[x,(0,r.jsxs)("div",{className:a().ownerAndDetails,children:[(0,r.jsx)(f.q,{src:t.owner.profile_image_url,ownerId:t.owner.id,handle:t.owner.handle,type:t.owner.type,size:20}),(0,r.jsxs)(s(),{href:"/".concat(t.owner.handle),children:["@",t.owner.handle]}),(0,r.jsxs)("span",{children:["• updated ",(0,r.jsx)(d.bM,{children:t.updated_at})]}),t.is_private&&(0,r.jsx)(l.J,{icon:"lock-fill"})]})]})}),(0,r.jsx)("td",{children:w})]})})},62457:function(e,t,n){n.d(t,{F6:function(){return l},Yb:function(){return d},sD:function(){return s}});var r=n(61575),i=n(83267),a=n(84512),o=n(35560);function s(e){var t,n,i,a,o,s,d,u,c;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!==(o=null===(t=e.team)||void 0===t?void 0:t.handle)&&void 0!==o?o:"",id:null!==(s=null===(n=e.team)||void 0===n?void 0:n.id)&&void 0!==s?s:-1,profile_image_url:null!==(d=null===(i=e.team)||void 0===i?void 0:i.profileImageUrl)&&void 0!==d?d: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!==(u=e.tags)&&void 0!==u?u:[],favoriteCount:e.starCount,matview_id:null!==(c=e.matviewId)&&void 0!==c?c:void 0,hasStarred:e.hasStarred,schedule:(0,r.$K)(e.schedules)?l(e.schedules[0]):void 0}}function d(e){var t,n,i,a,o,s,d,u;let c=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!==(o=null===(t=e.team)||void 0===t?void 0:t.handle)&&void 0!==o?o:"",id:null!==(s=null===(n=e.team)||void 0===n?void 0:n.id)&&void 0!==s?s:-1,profile_image_url:null!==(d=null===(i=e.team)||void 0===i?void 0:i.profileImageUrl)&&void 0!==d?d:void 0};return{id:e.id,name:e.name,slug:e.slug,isTrending:!1,created_at:e.createdAt,updated_at:e.updatedAt,owner:c,is_private:e.isPrivate,tags:null!==(u=e.tags)&&void 0!==u?u:[],favoriteCount:e.starCount,hasStarred:e.hasStarred,schedule:(0,r.$K)(e.schedules)?l(e.schedules[0]):void 0}}function l(e){return void 0!==e&&(0,r.$K)(e.cronExpression)&&(0,a.fN)(e.cronExpression)&&(0,r.$K)(e.performance)&&(0,o.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}},91161:function(e,t,n){n.d(t,{H:function(){return f}});var r=n(85893),i=n(51681),a=n(15490),o=n(69896),s=n.n(o),d=n(85533),l=n(24589),u=n(61575),c=n(62457);function h(e){let{content:t,refetchContent:n}=e;return(0,r.jsx)("table",{className:s().table,children:(0,r.jsx)("tbody",{children:null==t?void 0:t.map(e=>{switch(e.__typename){case"QueryModel":return(0,r.jsx)(d.G,{query:function(e){var t,n,r,i,a,o,s;let d=e.user?{type:"user",id:e.user.id,handle:e.user.handle,profile_image_url:null!==(t=e.user.profileImageUrl)&&void 0!==t?t:void 0}:e.team?{type:"team",id:null!==(n=e.team.id)&&void 0!==n?n:-1,handle:null!==(r=e.team.handle)&&void 0!==r?r:"",profile_image_url:null!==(i=e.team.profileImageUrl)&&void 0!==i?i:void 0}:void 0;if(!d)throw Error("No owner for query id=".concat(e.id));return{id:e.id,name:null!==(a=e.name)&&void 0!==a?a:"",created_at:e.createdAt,updated_at:e.updatedAt,owner:d,is_private:e.isPrivate,matview_id:null!==(o=e.matviewId)&&void 0!==o?o:void 0,tags:null!==(s=e.tags)&&void 0!==s?s:[],favoriteCount:e.starCount,hasStarred:e.hasStarred,contributors:e.contributors,schedule:(0,u.$K)(e.schedules)?(0,c.F6)(e.schedules[0]):void 0}}(e),origin:"creations",refetchFolderContent:n},"".concat(e.__typename,"-").concat(e.id));case"Dashboard":return(0,r.jsx)(l.f,{dashboard:function(e){var t,n,r,i,a,o;let s=e.user?{type:"user",id:e.user.id,handle:e.user.handle,profile_image_url:null!==(t=e.user.profileImageUrl)&&void 0!==t?t:void 0}:e.team?{type:"team",id:null!==(n=e.team.id)&&void 0!==n?n:-1,handle:null!==(r=e.team.handle)&&void 0!==r?r:"",profile_image_url:null!==(i=e.team.profileImageUrl)&&void 0!==i?i:void 0}:void 0;if(!s)throw Error("No owner for dasboard id=".concat(e.id));return{id:e.id,name:null!==(a=e.name)&&void 0!==a?a:"",slug:e.slug,created_at:e.createdAt,updated_at:e.updatedAt,tags:null!==(o=e.tags)&&void 0!==o?o:[],owner:s,is_private:e.isPrivate,favoriteCount:e.starCount,hasStarred:e.hasStarred,isTrending:e.isTrending,schedule:(0,u.$K)(e.schedules)?(0,c.F6)(e.schedules[0]):void 0}}(e),origin:"creations",refetchFolderContent:n},"".concat(e.__typename,"-").concat(e.id))}})})})}var v=n(81523);function f(e){let{content:t,fetchMore:n,renderEmpty:o}=e,s=(0,v.kk)(t.data);return 0===s.length&&t.loading?(0,r.jsx)(a.y,{}):(null==s?void 0:s.length)===0?(0,r.jsx)(r.Fragment,{children:o()}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h,{content:s,refetchContent:()=>{t.refetch()}}),(0,r.jsxs)(i.df,{onChange:e=>e&&(null==n?void 0:n(t)),children:[(0,r.jsx)("div",{}),t.loading&&(0,r.jsx)(a.y,{})]})]})}},81523:function(e,t,n){n.d(t,{XO:function(){return v},kk:function(){return h},oV:function(){return u}});var r=n(82729),i=n(78718),a=n.n(i),o=n(39137),s=n(84937),d=n(36986);function l(){let e=(0,r._)(["\n query LibraryContent(\n $contextOwner: ContextOwner!\n $filters: LibraryContentFiltersInput\n $orderBy: [OrderByInput!]\n $pagination: PaginationInput\n ) {\n libraryContent(\n contextOwner: $contextOwner\n filters: $filters\n orderBy: $orderBy\n pagination: $pagination\n ) {\n ...ContentConnection\n }\n }\n"]);return l=function(){return e},e}function u(e){let{session:t}=(0,d.a)(),n=function(e){let{activeContext:t}=(0,d.a)();return{contextOwner:a()(t,["id","type"]),filters:{content:function(){switch(e.filter.type){case"queries":return[s.zcD.Query];case"dashboards":return[s.zcD.Dashboard];case"all":return[s.zcD.Dashboard,s.zcD.Query];case void 0:return}}(),archived:e.filter.isArchived,folderId:function(){if(!e.folder)return;let{folderId:t,movingContent:n=!1}=e.folder;return n?{neq:t}:{eq:t}}(),privacy:function(){switch(e.filter.publicness){case"public":return[s.Isf.Public];case"private":return[s.Isf.Private];case"all":return}}(),materializedView:function(){switch(e.filter.isMatview){case!0:return!0;case!1:case void 0:return}}(),searchQuery:{query:e.filter.freetext}},orderBy:function(){switch(e.order.by){case"favorites":{let t="all"===e.order.time_range?"All":e.order.time_range;return[{key:"favorites".concat(t),direction:s.eQH.Desc}]}case"created_at":if("Asc"===e.order.order)return[{key:"createdAt",direction:s.eQH.Asc}];return[{key:"createdAt",direction:s.eQH.Desc}];case"updated_at":if("Asc"===e.order.order)return[{key:"updatedAt",direction:s.eQH.Asc}];return[{key:"updatedAt",direction:s.eQH.Desc}]}}(),pagination:e.pagination}}(e);return(0,s.dv5)({context:{session:t},variables:n,notifyOnNetworkStatusChange:!0})}function c(e){var t;return null!==(t=null==e?void 0:e.libraryContent)&&void 0!==t?t:{edges:[],pageInfo:null}}function h(e){return c(e).edges.map(e=>e.node)}function v(e){if(e.data&&e.variables&&e.data.libraryContent.pageInfo.hasNextPage){var t;e.fetchMore({variables:{...e.variables,pagination:{...e.variables.pagination,after:null===(t=c(e.data).pageInfo)||void 0===t?void 0:t.endCursor}}})}}(0,o.Z)(l())},15468:function(e,t,n){n.d(t,{t:function(){return s}});var r=n(82729),i=n(57831),a=n(84937);function o(){let e=(0,r._)(["\n mutation FavoriteDashboard($input: FavoriteDashboardInput!) {\n favoriteDashboard(input: $input) {\n id\n starCount\n hasStarred\n }\n }\n"]);return o=function(){return e},e}function s(){let e=(0,i.kP)(),[t,n]=(0,a.QyX)();return{favoriteDashboard:function(n){t({context:{session:e},variables:{input:{id:n}}})},favoriteDashboardMutationResult:n}}(0,n(39137).Z)(o())},15801:function(e,t,n){n.d(t,{s:function(){return s}});var r=n(82729),i=n(57831),a=n(84937);function o(){let e=(0,r._)(["\n mutation UnfavoriteDashboard($input: UnfavoriteDashboardInput!) {\n unfavoriteDashboard(input: $input) {\n id\n starCount\n hasStarred\n }\n }\n"]);return o=function(){return e},e}function s(){let e=(0,i.kP)(),[t,n]=(0,a.LhV)();return{unfavoriteDashboard:function(n){t({context:{session:e},variables:{input:{id:n}}})},unfavoriteDashboardMutationResult:n}}(0,n(39137).Z)(o())},51681:function(e,t,n){n.d(t,{YD:function(){return v},df:function(){return h}});var r=n(67294),i=Object.defineProperty,a=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o=(e,t,n)=>(a(e,"symbol"!=typeof t?t+"":t,n),n),s=new Map,d=new WeakMap,l=0,u=void 0;function c(e,t,n={},r=u){if(void 0===window.IntersectionObserver&&void 0!==r){let i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}let{id:i,observer:a,elements:o}=function(e){let t=Object.keys(e).sort().filter(t=>void 0!==e[t]).map(t=>{var n;return`${t}_${"root"===t?(n=e.root)?(d.has(n)||(l+=1,d.set(n,l.toString())),d.get(n)):"0":e[t]}`}).toString(),n=s.get(t);if(!n){let r;let i=new Map,a=new IntersectionObserver(t=>{t.forEach(t=>{var n;let a=t.isIntersecting&&r.some(e=>t.intersectionRatio>=e);e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=a),null==(n=i.get(t.target))||n.forEach(e=>{e(a,t)})})},e);r=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:a,elements:i},s.set(t,n)}return n}(n),c=o.get(e)||[];return o.has(e)||o.set(e,c),c.push(t),a.observe(e),function(){c.splice(c.indexOf(t),1),0===c.length&&(o.delete(e),a.unobserve(e)),0===o.size&&(a.disconnect(),s.delete(i))}}var h=class extends r.Component{constructor(e){super(e),o(this,"node",null),o(this,"_unobserveCb",null),o(this,"handleNode",e=>{!this.node||(this.unobserve(),e||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=e||null,this.observeNode()}),o(this,"handleChange",(e,t)=>{e&&this.props.triggerOnce&&this.unobserve(),"function"!=typeof this.props.children||this.setState({inView:e,entry:t}),this.props.onChange&&this.props.onChange(e,t)}),this.state={inView:!!e.initialInView,entry:void 0}}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(e){(e.rootMargin!==this.props.rootMargin||e.root!==this.props.root||e.threshold!==this.props.threshold||e.skip!==this.props.skip||e.trackVisibility!==this.props.trackVisibility||e.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;let{threshold:e,root:t,rootMargin:n,trackVisibility:r,delay:i,fallbackInView:a}=this.props;this._unobserveCb=c(this.node,this.handleChange,{threshold:e,root:t,rootMargin:n,trackVisibility:r,delay:i},a)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){let{children:e}=this.props;if("function"==typeof e){let{inView:t,entry:n}=this.state;return e({inView:t,entry:n,ref:this.handleNode})}let{as:t,triggerOnce:n,threshold:i,root:a,rootMargin:o,onChange:s,skip:d,trackVisibility:l,delay:u,initialInView:c,fallbackInView:h,...v}=this.props;return r.createElement(t||"div",{ref:this.handleNode,...v},e)}};function v({threshold:e,delay:t,trackVisibility:n,rootMargin:i,root:a,triggerOnce:o,skip:s,initialInView:d,fallbackInView:l,onChange:u}={}){var h;let[v,f]=r.useState(null),p=r.useRef(),[m,g]=r.useState({inView:!!d,entry:void 0});p.current=u,r.useEffect(()=>{let r;if(!s&&v)return r=c(v,(e,t)=>{g({inView:e,entry:t}),p.current&&p.current(e,t),t.isIntersecting&&o&&r&&(r(),r=void 0)},{root:a,rootMargin:i,threshold:e,trackVisibility:n,delay:t},l),()=>{r&&r()}},[Array.isArray(e)?e.toString():e,v,a,i,o,s,n,l,t]);let b=null==(h=m.entry)?void 0:h.target,x=r.useRef();v||!b||o||s||x.current===b||(x.current=b,g({inView:!!d,entry:void 0}));let y=[f,m.inView,m.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}}}]);
//# sourceMappingURL=1161-a3ae0bd0adcf8c0e.js.map