angular_wrappers.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { react2AngularDirective } from 'app/core/utils/react2angular';
  2. import { QueryEditor as StackdriverQueryEditor } from 'app/plugins/datasource/stackdriver/components/QueryEditor';
  3. import { AnnotationQueryEditor as StackdriverAnnotationQueryEditor } from 'app/plugins/datasource/stackdriver/components/AnnotationQueryEditor';
  4. import PageHeader from './components/PageHeader/PageHeader';
  5. import EmptyListCTA from './components/EmptyListCTA/EmptyListCTA';
  6. import { TagFilter } from './components/TagFilter/TagFilter';
  7. import { SideMenu } from './components/sidemenu/SideMenu';
  8. import { MetricSelect } from './components/Select/MetricSelect';
  9. import AppNotificationList from './components/AppNotifications/AppNotificationList';
  10. import { ColorPicker, SeriesColorPickerPopoverWithTheme, SecretFormField, DataLinksEditor } from '@grafana/ui';
  11. import { FunctionEditor } from 'app/plugins/datasource/graphite/FunctionEditor';
  12. import { SearchField } from './components/search/SearchField';
  13. import { GraphContextMenu } from 'app/plugins/panel/graph/GraphContextMenu';
  14. import ReactProfileWrapper from 'app/features/profile/ReactProfileWrapper';
  15. export function registerAngularDirectives() {
  16. react2AngularDirective('sidemenu', SideMenu, []);
  17. react2AngularDirective('functionEditor', FunctionEditor, ['func', 'onRemove', 'onMoveLeft', 'onMoveRight']);
  18. react2AngularDirective('appNotificationsList', AppNotificationList, []);
  19. react2AngularDirective('pageHeader', PageHeader, ['model', 'noTabs']);
  20. react2AngularDirective('emptyListCta', EmptyListCTA, ['model']);
  21. react2AngularDirective('searchField', SearchField, [
  22. 'query',
  23. 'autoFocus',
  24. ['onChange', { watchDepth: 'reference' }],
  25. ['onKeyDown', { watchDepth: 'reference' }],
  26. ]);
  27. react2AngularDirective('tagFilter', TagFilter, [
  28. 'tags',
  29. ['onChange', { watchDepth: 'reference' }],
  30. ['tagOptions', { watchDepth: 'reference' }],
  31. ]);
  32. react2AngularDirective('colorPicker', ColorPicker, [
  33. 'color',
  34. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  35. ]);
  36. react2AngularDirective('seriesColorPickerPopover', SeriesColorPickerPopoverWithTheme, [
  37. 'color',
  38. 'series',
  39. 'onColorChange',
  40. 'onToggleAxis',
  41. ]);
  42. react2AngularDirective('metricSelect', MetricSelect, [
  43. 'options',
  44. 'onChange',
  45. 'value',
  46. 'isSearchable',
  47. 'className',
  48. 'placeholder',
  49. ['variables', { watchDepth: 'reference' }],
  50. ]);
  51. react2AngularDirective('stackdriverQueryEditor', StackdriverQueryEditor, [
  52. 'target',
  53. 'onQueryChange',
  54. 'onExecuteQuery',
  55. ['events', { watchDepth: 'reference' }],
  56. ['datasource', { watchDepth: 'reference' }],
  57. ['templateSrv', { watchDepth: 'reference' }],
  58. ]);
  59. react2AngularDirective('stackdriverAnnotationQueryEditor', StackdriverAnnotationQueryEditor, [
  60. 'target',
  61. 'onQueryChange',
  62. 'onExecuteQuery',
  63. ['datasource', { watchDepth: 'reference' }],
  64. ['templateSrv', { watchDepth: 'reference' }],
  65. ]);
  66. react2AngularDirective('secretFormField', SecretFormField, [
  67. 'value',
  68. 'isConfigured',
  69. 'inputWidth',
  70. 'labelWidth',
  71. ['onReset', { watchDepth: 'reference', wrapApply: true }],
  72. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  73. ]);
  74. react2AngularDirective('graphContextMenu', GraphContextMenu, [
  75. 'x',
  76. 'y',
  77. 'items',
  78. ['onClose', { watchDepth: 'reference', wrapApply: true }],
  79. ['getContextMenuSource', { watchDepth: 'reference', wrapApply: true }],
  80. ['formatSourceDate', { watchDepth: 'reference', wrapApply: true }],
  81. ]);
  82. // We keep the drilldown terminology here because of as using data-* directive
  83. // being in conflict with HTML data attributes
  84. react2AngularDirective('drilldownLinksEditor', DataLinksEditor, [
  85. 'value',
  86. 'suggestions',
  87. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  88. ]);
  89. react2AngularDirective('reactProfileWrapper', ReactProfileWrapper, []);
  90. }