"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4074],{3847:(e,a,n)=>{n.r(a),n.d(a,{DashboardListPage:()=>M,default:()=>S});var s=n(36636),r=n(68404),o=n(18745),l=n(94087),t=n(43215),i=n(90923),d=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(71625),y=n(28237),j=n(13407),N=n(45916);const w=r.memo((e=>{var a;let{folder:n}=e;const o=(0,m.useStyles2)(C),{query:l,onQueryChange:t}=(0,b.A)({}),d=null==n?void 0:n.id,c=null==n?void 0:n.canSave,u=n?c:v.Vt.hasEditPermissionInFolders;let[p,h]=(0,g.Z)(x.to,!0);i.config.featureToggles.panelTitleSearch||(p=!1);const{isEditor:w}=v.Vt,[k,M]=(0,r.useState)(null!==(a=l.query)&&void 0!==a?a:"");return(0,f.Z)((()=>t(k)),200,[k]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:(0,s.cx)(o.actionBar,"page-action-bar"),children:[(0,N.jsx)("div",{className:(0,s.cx)(o.inputWrapper,"gf-form gf-form--grow m-r-2"),children:(0,N.jsx)(m.Input,{value:k,onChange:e=>{e.preventDefault(),M(e.currentTarget.value)},autoFocus:!0,spellCheck:!1,placeholder:p?"Search for dashboards and panels":"Search for dashboards",className:o.searchInput,suffix:null})}),(0,N.jsx)(j.F,{isEditor:w,canEdit:u||c,folderId:d})]}),(0,N.jsx)(y.Z,{showManage:w||u||c,folderDTO:n,queryText:l.query,onQueryTextChange:e=>{M(e)},hidePseudoFolders:!0,includePanels:p,setIncludePanels:h})]})}));w.displayName="ManageDashboardsNew";const k=w,C=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};
  `}),M=(0,r.memo)((e=>{var a;let{navModel:n,match:r,location:o}=e;const{loading:c,value:g}=(0,l.Z)((()=>{const e=r.params.uid,a=o.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 r=t.locationUtil.stripBaseFromUrl(a.url);return r!==o.pathname&&i.locationService.push(r),{folder:a,pageNavModel:Object.assign({},n,{main:s})}})):Promise.resolve({pageNavModel:n})}),[r.params.uid]);return(0,N.jsx)(d.Z,{navModel:null!==(a=null==g?void 0:g.pageNavModel)&&void 0!==a?a:n,children:Boolean(i.config.featureToggles.panelTitleSearch)?(0,N.jsx)(d.Z.Contents,{isLoading:c,className:s.css`
            display: flex;
            flex-direction: column;
            overflow: hidden;
          `,children:(0,N.jsx)(k,{folder:null==g?void 0:g.folder})}):(0,N.jsx)(d.Z.Contents,{isLoading:c,children:(0,N.jsx)(h.Z,{folder:null==g?void 0:g.folder})})})}));M.displayName="DashboardListPage";const S=(0,o.connect)((e=>({navModel:(0,c.h)(e.navIndex,"manage-dashboards")})))(M)}}]);
//# sourceMappingURL=DashboardListPage.a84b5c51dd5414a40b1a.js.map