"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4004],{65242:(g,d,t)=>{t.r(d),t.d(d,{DataSourcePermissionsUpgradePage:()=>i,default:()=>D});var n=t(74848),o=t(54148),_=t(54122),r=t(95374),e=t(19393);const i=()=>{const{uid:E=""}=(0,o.g)(),{navId:u,pageNav:l}=(0,r.n)("permissions");return(0,n.jsx)(_.Y,{navId:u,pageNav:l,children:(0,n.jsx)(_.Y.Contents,{children:(0,n.jsx)(e.Ay,{uid:E})})})},D=i},19393:(g,d,t)=>{t.d(d,{Ay:()=>D});var n=t(74848),o=t(29675),_=t(99528),r=t(12786);const e=({uid:E})=>((0,r.oU)(E),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_.Iz,{featureName:"data source permissions",featureId:"data-source-permissions"}),(0,n.jsx)(i,{})]})),i=({action:E})=>{const u=(0,o.$j)();return(0,n.jsx)(_.El,{action:E,featureName:"data source permissions",description:"With data source permissions, you can protect sensitive data by limiting access to this data source to specific users, teams, and roles.",listItems:["Protect sensitive data, like security logs, production databases, and personally-identifiable information","Clean up users\u2019 experience by hiding data sources they don\u2019t need to use","Share Grafana access more freely, knowing that users will not unwittingly see sensitive data"],image:`ds-permissions-${u.isLight?"light":"dark"}.png`,featureUrl:"https://grafana.com/docs/grafana/latest/enterprise/datasource_permissions"})},D=e},95374:(g,d,t)=>{t.d(d,{n:()=>E});var n=t(54148),o=t(98437),_=t(12636),r=t(802),e=t(96326),i=t(11241),D=t(61491);function E(u){const{uid:l=""}=(0,n.g)(),U=(0,n.zy)(),p=(0,r.xw)(l),h=(0,r.S4)(p.type),A=(0,i.ob)(p.type),L=new URLSearchParams(U.search),S=u||L.get("page"),{plugin:M,loadError:m,loading:C}=(0,r._e)(),O=(0,o.l)()?.getInstanceSettings(l),T=!!(O?.meta?.alerting??!1),I=O?.type==="alertmanager",B=T||I,v=(0,D.useSelector)(c=>c.navIndex),a=S?`datasource-${S}-${l}`:`datasource-settings-${l}`;let s={node:{text:"Data Source Nav Node"},main:{text:"Data Source Nav Node"}};if(m){const c={text:m,subTitle:"Data Source Error",icon:"exclamation-triangle"};s={node:c,main:c}}return(C||!M)&&(s=(0,_.tc)(v,a,(0,e.$m)("settings"))),M&&(s=(0,_.tc)(v,a,(0,e.Vh)((0,e.R4)(p,M),S||"settings"))),{navId:"connections-datasources",pageNav:{...s.main,dataSourcePluginName:A?.name||M?.meta.name||"",active:!0,text:p.name,subTitle:`Type: ${h.name}`,children:(s.main.children||[]).map(c=>({...c,url:c.url?.replace("datasources/edit/","/connections/datasources/edit/")}))},dataSourceHeader:{alertingSupported:B}}}},802:(g,d,t)=>{t.d(d,{$k:()=>C,BY:()=>h,S4:()=>I,Tn:()=>T,US:()=>A,Um:()=>M,_e:()=>B,hx:()=>S,k9:()=>m,oU:()=>p,u1:()=>v,xw:()=>O});var n=t(96540),o=t(40449),_=t(22492),r=t(87638),e=t(61491),i=t(91830),D=t(61674),E=t(47310),u=t(46760),l=t(26629),U=t(2196);const p=a=>{const s=(0,e.useDispatch)();(0,n.useEffect)(()=>(s((0,u.PK)(a)),function(){s((0,o.N)({cleanupAction:c=>c.dataSourceSettings=l.IJ}))}),[a,s])},h=a=>{const s=(0,e.useDispatch)();return()=>s((0,u.Ge)(a,D.b.DataSourcesEdit))},A=()=>{const a=(0,e.useDispatch)(),s=(0,e.useSelector)(c=>c.dataSources.isLoadingDataSources),P=(0,e.useSelector)(c=>c.dataSources.dataSources);return(0,n.useEffect)(()=>{a((0,u.bn)())},[a]),{isLoading:s,dataSources:P}},L=a=>{const s=useDispatch();useEffect(()=>{s(loadDataSource(a))},[s,a])},S=()=>{const a=(0,e.useDispatch)();(0,n.useEffect)(()=>{a((0,u.G2)())},[a])},M=()=>{const a=(0,e.useDispatch)();return s=>{a((0,u.du)(s,D.b.DataSourcesEdit))}},m=()=>{const a=(0,e.useDispatch)();return async s=>a((0,u.jB)(s))},C=()=>{const a=(0,e.useDispatch)(),{name:s}=(0,e.useSelector)(P=>P.dataSources.dataSource);return()=>{_.A.publish(new i.bY({title:"Delete",text:`Are you sure you want to delete the "${s}" data source?`,yesText:"Delete",icon:"trash-alt",onConfirm:()=>a((0,u.Qq)())}))}},O=a=>(0,e.useSelector)(s=>(0,U.U4)(s.dataSources,a)),T=a=>{const s=O(a);return(0,E.h)(s)},I=a=>(0,e.useSelector)(s=>(0,U.Fj)(s.dataSources,a)),B=()=>(0,e.useSelector)(a=>a.dataSourceSettings),v=a=>{const s=O(a),P=s.readOnly===!0,c=r.TP.hasPermissionInMetadata(e.AccessControlAction.DataSourcesWrite,s),f=r.TP.hasPermissionInMetadata(e.AccessControlAction.DataSourcesDelete,s);return{readOnly:P,hasWriteRights:c,hasDeleteRights:f}}},12786:(g,d,t)=>{t.d(d,{$k:()=>o.$k,$m:()=>_.$m,BY:()=>o.BY,Bs:()=>r.Bs,C_:()=>r.C_,S4:()=>o.S4,Tk:()=>r.Tk,Tn:()=>o.Tn,US:()=>o.US,Um:()=>o.Um,_e:()=>o._e,du:()=>n.du,eB:()=>r.eB,hp:()=>e.hp,hx:()=>o.hx,jz:()=>r.jz,k9:()=>o.k9,lv:()=>e.lv,oU:()=>o.oU,rb:()=>r.rb,u1:()=>o.u1,wC:()=>e.wC,xs:()=>e.xs,xw:()=>o.xw,zC:()=>e.zC});var n=t(46760),o=t(802),_=t(96326),r=t(26629),e=t(2196)},47310:(g,d,t)=>{t.d(d,{h:()=>_});var n=t(93407),o=t(2567);const _=r=>{const e=JSON.stringify({datasource:r.name,context:"explore"});return n.kM.renderUrl(o.I.assureBaseUrl("/explore"),{left:e})}}}]);

//# sourceMappingURL=ConnectionsDataSourcePermissionsUpgradePage.6bcf69b7e25f9b8a13f0.js.map