Просмотр исходного кода

dashfolders: Send down backendSrv to the react components #10275

Johannes Schill 8 лет назад
Родитель
Сommit
2de0489868

+ 1 - 0
public/app/containers/IContainerProps.ts

@@ -12,6 +12,7 @@ interface IContainerProps {
   alertList: typeof AlertListStore.Type;
   alertList: typeof AlertListStore.Type;
   view: typeof ViewStore.Type;
   view: typeof ViewStore.Type;
   folder: typeof FolderStore.Type;
   folder: typeof FolderStore.Type;
+  backendSrv: any;
 }
 }
 
 
 export default IContainerProps;
 export default IContainerProps;

+ 1 - 1
public/app/containers/ManageDashboards/FolderPermissions.tsx

@@ -33,7 +33,7 @@ export class FolderPermissions extends Component<IContainerProps, any> {
     return (
     return (
       <div>
       <div>
         <PageHeader model={nav as any} />
         <PageHeader model={nav as any} />
-        <Permissions isFolder={true} error="" newType="" dashboardId={1} />
+        <Permissions isFolder={true} error="" newType="" dashboardId={1} backendSrv={this.props.backendSrv} />
       </div>
       </div>
     );
     );
   }
   }

+ 4 - 2
public/app/routes/ReactContainer.tsx

@@ -13,13 +13,15 @@ function WrapInProvider(store, Component, props) {
 }
 }
 
 
 /** @ngInject */
 /** @ngInject */
-export function reactContainer($route, $location) {
+export function reactContainer($route, $location, backendSrv) {
   return {
   return {
     restrict: 'E',
     restrict: 'E',
     template: '',
     template: '',
     link(scope, elem) {
     link(scope, elem) {
       let component = $route.current.locals.component;
       let component = $route.current.locals.component;
-      let props = {};
+      let props = {
+        backendSrv: backendSrv,
+      };
 
 
       ReactDOM.render(WrapInProvider(store, component, props), elem[0]);
       ReactDOM.render(WrapInProvider(store, component, props), elem[0]);