"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4074],{3847:(e,a,n)=>{n.r(a),n.d(a,{DashboardListPage:()=>S,default:()=>T});var s=n(36636),o=n(68404),r=n(18745),t=n(94087),l=n(43215),d=n(90923),i=n(33801),c=n(8674),u=n(28659),p=n(49545);var h=n(45704),g=n(40652),f=n(17873),m=n(69783),v=n(61959),x=n(97621),b=n(51189),y=n(71625),j=n(28237),w=n(13407),N=n(45916);const k=o.memo((e=>{var a;let{folder:n}=e;const r=(0,m.useStyles2)(M),{query:t,onQueryChange:l}=(0,y.A)({}),{onKeyDown:i,keyboardEvents:c}=(0,b.A)(),u=null==n?void 0:n.id,p=null==n?void 0:n.canSave,h=n?p:v.Vt.hasEditPermissionInFolders;let[k,C]=(0,g.Z)(x.to,!0);d.config.featureToggles.panelTitleSearch||(k=!1);const{isEditor:S}=v.Vt,[T,Z]=(0,o.useState)(null!==(a=t.query)&&void 0!==a?a:"");return(0,f.Z)((()=>l(T)),200,[T]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:(0,s.cx)(r.actionBar,"page-action-bar"),children:[(0,N.jsx)("div",{className:(0,s.cx)(r.inputWrapper,"gf-form gf-form--grow m-r-2"),children:(0,N.jsx)(m.Input,{value:T,onChange:e=>{e.preventDefault(),Z(e.currentTarget.value)},onKeyDown:i,autoFocus:!0,spellCheck:!1,placeholder:k?"Search for dashboards and panels":"Search for dashboards",className:r.searchInput,suffix:null})}),(0,N.jsx)(w.F,{isEditor:S,canEdit:h||p,folderId:u})]}),(0,N.jsx)(j.Z,{showManage:S||h||p,folderDTO:n,queryText:t.query,onQueryTextChange:e=>{Z(e)},hidePseudoFolders:!0,includePanels:k,setIncludePanels:C,keyboardEvents:c})]})}));k.displayName="ManageDashboardsNew";const C=k,M=e=>({actionBar:s.css` ${e.breakpoints.down("sm")} { flex-wrap: wrap; } `,inputWrapper:s.css` ${e.breakpoints.down("sm")} { margin-right: 0 !important; } `,searchInput:s.css` margin-bottom: 6px; min-height: ${e.spacing(4)}; `,unsupported:s.css` padding: 10px; display: flex; align-items: center; justify-content: center; height: 100%; font-size: 18px; `,noResults:s.css` padding: ${e.v1.spacing.md}; background: ${e.v1.colors.bg2}; font-style: italic; margin-top: ${e.v1.spacing.md}; `}),S=(0,o.memo)((e=>{var a;let{navModel:n,match:o,location:r}=e;const{loading:c,value:g}=(0,t.Z)((()=>{const e=o.params.uid,a=r.pathname;return e&&a.startsWith("/dashboards")?(e=>u.ae.getFolderByUid(e).then((e=>{const a=(0,p.B)(e);return a.children[0].active=!0,{folder:e,folderNav:a}})))(e).then((e=>{let{folder:a,folderNav:s}=e;const o=l.locationUtil.stripBaseFromUrl(a.url);return o!==r.pathname&&d.locationService.push(o),{folder:a,pageNavModel:Object.assign({},n,{main:s})}})):Promise.resolve({pageNavModel:n})}),[o.params.uid]);return(0,N.jsx)(i.Z,{navModel:null!==(a=null==g?void 0:g.pageNavModel)&&void 0!==a?a:n,children:Boolean(d.config.featureToggles.panelTitleSearch)?(0,N.jsx)(i.Z.Contents,{isLoading:c,className:s.css` display: flex; flex-direction: column; overflow: hidden; `,children:(0,N.jsx)(C,{folder:null==g?void 0:g.folder})}):(0,N.jsx)(i.Z.Contents,{isLoading:c,children:(0,N.jsx)(h.Z,{folder:null==g?void 0:g.folder})})})}));S.displayName="DashboardListPage";const T=(0,r.connect)((e=>({navModel:(0,c.h)(e.navIndex,"manage-dashboards")})))(S)}}]); //# sourceMappingURL=DashboardListPage.4edf25537c58e0b7c069.js.map