forked from duneanalytics/DuneQueryRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlibrary-5e062263e6b5fe28.js.download
2 lines (2 loc) · 8.41 KB
/
library-5e062263e6b5fe28.js.download
1
2
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[140],{52783:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/workspace/u/[handle]/library",function(){return n(79748)}])},79051:function(e,r,n){"use strict";n.d(r,{S:function(){return w}});var t=n(85893),o=n(31821),i=n(37242),s=n(32546),l=n(77251),d=n(41499),c=n(90869),a=n(55114),u=n(32279),h=n(17081),f=n(91161),x=n(77046),j=n(81523),v=n(41042),p=n(69339),_=n(18035),m=n(87257);function w(){let e=c.e(),r=a.e(),n=u.e(),w=(0,j.oV)({filter:{freetext:e.debouncedValue,publicness:r.value,type:"all",isArchived:!1},order:n.value,pagination:{first:20}}),C=(0,p.L)();switch((0,v.e)(C.value,{getUrl:e=>(0,_.Y)(e)}),C.status){case"LOADING":return(0,t.jsx)(i.h,{});case"INVALID":return(0,t.jsx)(m.C,{urlContext:C.invalidValue})}let b=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.E,{activePage:"Home"}),(0,t.jsx)(l.$0,{title:"Show",children:(0,t.jsx)(a.h,{publicnessFilterState:r})}),(0,t.jsx)(u.h,{orderState:n}),(0,t.jsx)(c.p,{searchStringState:e,placeholder:"Search content"})]});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.yG,{title:"Library"}),(0,t.jsxs)(s.T3,{children:[(0,t.jsx)(s.h4,{renderLibraryMobileMenu:()=>b}),(0,t.jsxs)(s.or,{children:[(0,t.jsx)(l.im,{children:b}),(0,t.jsx)(s.JH,{children:(0,t.jsxs)(s.Kb,{children:[(0,t.jsx)(h.d,{}),(0,t.jsx)(f.H,{content:w,fetchMore:j.XO,renderEmpty:()=>(0,t.jsx)(x.g,{hasFiltersApplied:!(""===e.debouncedValue&&"all"===r.value)})})]})})]})]})]})}},77046:function(e,r,n){"use strict";n.d(r,{g:function(){return u}});var t=n(85893),o=n(54173),i=n(18035),s=n(36986),l=n(25675),d=n.n(l),c=n(42661),a=n(7395);function u(e){let{hasFiltersApplied:r}=e,{activeContext:n}=(0,s.a)();return(0,t.jsx)(a.u,{title:r?"There are no queries or dashboards matching selected filters":"No content yet!",description:!r&&"Queries and dashboards you create will show up here.",illustration:(0,t.jsx)(d(),{alt:"",src:c.Z,width:190,height:200}),actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.A,{size:"M",theme:"primary",href:"/queries",children:"New query"}),r&&(0,t.jsx)(o.A,{size:"M",theme:"tertiary",href:(0,i.Y)(n),children:"Show all"})]})})}},40401:function(e,r,n){"use strict";n.d(r,{r:function(){return v}});var t=n(85893),o=n(6688),i=n.n(o),s=n(94184),l=n.n(s),d=n(89912),c=n(1801),a=n(37743),u=n(41664),h=n.n(u),f=n(47730),x=n(18035),j=n(36986);function v(e){let{description:r,tiny:n=!1}=e;return n&&void 0!==r&&""!==r?(0,t.jsx)(f.u,{label:r,position:"below-center",children:(0,t.jsx)("div",{children:(0,t.jsx)(p,{...e})})}):(0,t.jsx)(p,{...e})}function p(e){let{activeContext:r}=(0,j.a)(),{name:n,contentLength:o,path:s,description:u,tiny:f=!1}=e,v=(0,d.q7)(e.icon),p={"--customColor":"".concat((0,d.Lq)(e.color))};return(0,t.jsxs)(h(),{href:(0,x.Y)(r)+"/folders".concat(s),className:l()(i().tile,f&&i().tiny),style:p,children:[(0,t.jsxs)("div",{className:l()(i().content,f&&i().tiny),children:[(0,t.jsx)("div",{className:i().folderIcon,children:v}),(0,t.jsxs)("div",{className:i().folderDetails,children:[(0,t.jsx)("h1",{className:i().folderName,children:n}),!f&&(0,t.jsx)("div",{className:i().description,children:u})]})]}),!f&&(0,t.jsx)("div",{className:i().footer,children:void 0!==o&&(0,t.jsxs)(c.C,{size:"M",variant:"filled",color:"neutral",children:[(0,t.jsx)(a.IconSquareHalf,{}),o]})})]})}},50132:function(e,r,n){"use strict";n.d(r,{n:function(){return s}});var t=n(85893),o=n(6688),i=n.n(o);function s(e){let{children:r}=e;return(0,t.jsx)("div",{className:i().tileGroup,children:r})}},17081:function(e,r,n){"use strict";n.d(r,{d:function(){return m}});var t=n(85893),o=n(15490),i=n(40401),s=n(75485),l=n(50132),d=n(36986),c=n(94184),a=n.n(c),u=n(6688),h=n.n(u),f=n(58047),x=n(96740),j=n(85361),v=n(3602),p=n(47730);function _(e){var r;let n=(0,j._0)();if(!n)return null;let o=null!==(r=n.serviceTier.maxFolders)&&void 0!==r?r:0,i=e.foldersCount>=o;return(0,t.jsx)(x.u,{size:"M",label:"Create folder",content:r=>{let{close:o}=r;return(0,t.jsx)(v.J,{onDismiss:o,refetchFolders:e.refetchFolders,owner:n})},trigger:e=>{let{onClick:r}=e;return(0,t.jsx)(p.u,{hidden:!i,label:"You've reached the folder limit.",position:"below-center",children:(0,t.jsx)("button",{className:a()(h().tile,h().tiny,h().dashed,i&&h().disabled),style:{"--customColor":"var(--feedback--accent--neutral)"},onClick:r,disabled:i,children:(0,t.jsx)("div",{className:a()(h().content,h().tiny,i&&h().disabled),children:(0,t.jsxs)("div",{className:a()(h().content,h().tiny),children:[(0,t.jsx)("div",{className:h().folderIcon,children:(0,t.jsx)(f.IconFolderPlus,{})}),(0,t.jsx)("div",{className:h().folderDetails,children:(0,t.jsx)("h1",{className:h().folderName,children:"New Folder"})})]})})})})}})}function m(e){var r,n,c,a,u;let{session:h,activeContext:f}=(0,d.a)(),x=(0,s.Q)(h,{owner:f}),j=null!==(c=null===(r=x.data)||void 0===r?void 0:r.folders.folders.length)&&void 0!==c?c:0,v=async()=>{await x.refetch()};if(x.loading)return(0,t.jsx)(o.g,{});let{freetext:p=""}=null!==(a=e.filter)&&void 0!==a?a:{},m=p.toLowerCase(),b=null===(n=x.data)||void 0===n?void 0:n.folders.folders.filter(w(m)).sort((e,r)=>C(r,m)-C(e,m));return(0,t.jsxs)(l.n,{children:[(0,t.jsx)(i.r,{icon:"folder",color:"gray",name:"Creations",path:"/creations",description:"Home for your queries and dashboards.",tiny:!0}),null==b?void 0:b.map(e=>(0,t.jsx)(i.r,{icon:e.icon,color:e.color,name:e.name,path:e.path,description:null!==(u=e.description)&&void 0!==u?u:void 0,tiny:!0},e.id)),(0,t.jsx)(i.r,{icon:"archive",color:"red",name:"Archived",path:"/archived",description:"All your archived queries and dashboards live here.",tiny:!0}),(0,t.jsx)(_,{foldersCount:j,refetchFolders:v})]})}let w=e=>""===e?()=>!0:r=>{var n;return r.name.toLowerCase().includes(e)||(null===(n=r.description)||void 0===n?void 0:n.toLowerCase().includes(e))};function C(e,r){var n;return 2*Number(e.name.toLowerCase().includes(r))+1*Number(null===(n=e.description)||void 0===n?void 0:n.toLowerCase().includes(r))}},58047:function(e,r,n){"use strict";n.r(r),n.d(r,{IconFolderPlus:function(){return o}});var t=n(85893);function o(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M13.5562 13H2.4625C2.40176 13 2.34162 12.988 2.28551 12.9648C2.2294 12.9416 2.17841 12.9075 2.13546 12.8645C2.09252 12.8216 2.05845 12.7706 2.03521 12.7145C2.01196 12.6584 2 12.5982 2 12.5375V5H13.5C13.6326 5 13.7598 5.05268 13.8536 5.14645C13.9473 5.24021 14 5.36739 14 5.5V12.5562C14 12.6739 13.9532 12.7868 13.87 12.87C13.7868 12.9532 13.6739 13 13.5562 13Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M2 5V3.5C2 3.36739 2.05268 3.24022 2.14645 3.14645C2.24021 3.05268 2.36739 3 2.5 3H5.79375C5.85868 2.99978 5.92301 3.01236 5.98307 3.03702C6.04312 3.06169 6.09773 3.09796 6.14375 3.14375L8 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M6.5 9H9.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8 7.5V10.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]})}},37743:function(e,r,n){"use strict";n.r(r),n.d(r,{IconSquareHalf:function(){return o}});var t=n(85893);function o(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8.5 3V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M3 6.5H8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M3 9.5H8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("rect",{x:"2.5",y:"2.5",width:"11",height:"11",rx:"1",stroke:"currentColor"})]})}},79748:function(e,r,n){"use strict";n.r(r);var t=n(36986),o=n(79051);r.default=(0,t.c)(o.S)},6688:function(e){e.exports={tile:"FolderTile_tile__9OJ5W",tiny:"FolderTile_tiny__P5KnB",disabled:"FolderTile_disabled__id6aE",dashed:"FolderTile_dashed__6uKBd",content:"FolderTile_content__ebR7w",folderIcon:"FolderTile_folderIcon__BdyKQ",folderDetails:"FolderTile_folderDetails__OCN_h",folderName:"FolderTile_folderName__SfKbh",description:"FolderTile_description__ZgJt8",footer:"FolderTile_footer__pKtY9",tileGroup:"FolderTile_tileGroup__uYFZ5",upgradeButton:"FolderTile_upgradeButton__D1UZC"}}},function(e){var r=function(r){return e(e.s=r)};e.O(0,[9225,3318,8110,3295,777,6746,5675,1444,9002,9938,9694,4974,819,1532,4465,8785,1161,9774,2888,179],function(){return r(73611),r(52783)}),_N_E=e.O()}]);
//# sourceMappingURL=library-5e062263e6b5fe28.js.map