"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4074],{50418:(e,a,n)=>{n.r(a),n.d(a,{DashboardListPage:()=>S,default:()=>T});var s=n(68490),o=n(76687),r=n(46958),t=n(8650),l=n(19177),d=n(10967),i=n(36131),c=n(3276),u=n(22260),p=n(92114);var h=n(53277),g=n(61478),f=n(51733),m=n(70534),v=n(69369),x=n(14970),b=n(74841),y=n(92691),j=n(46295),w=n(90924),N=n(52010);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.5693ac1756deaade8013.js.map