angular_wrappers.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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, [
  21. 'title',
  22. 'buttonIcon',
  23. 'buttonLink',
  24. 'buttonTitle',
  25. ['onClick', { watchDepth: 'reference', wrapApply: true }],
  26. 'proTip',
  27. 'proTipLink',
  28. 'proTipLinkTitle',
  29. 'proTipTarget',
  30. 'infoBox',
  31. 'infoBoxTitle',
  32. ]);
  33. react2AngularDirective('searchField', SearchField, [
  34. 'query',
  35. 'autoFocus',
  36. ['onChange', { watchDepth: 'reference' }],
  37. ['onKeyDown', { watchDepth: 'reference' }],
  38. ]);
  39. react2AngularDirective('tagFilter', TagFilter, [
  40. 'tags',
  41. ['onChange', { watchDepth: 'reference' }],
  42. ['tagOptions', { watchDepth: 'reference' }],
  43. ]);
  44. react2AngularDirective('colorPicker', ColorPicker, [
  45. 'color',
  46. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  47. ]);
  48. react2AngularDirective('seriesColorPickerPopover', SeriesColorPickerPopoverWithTheme, [
  49. 'color',
  50. 'series',
  51. 'onColorChange',
  52. 'onToggleAxis',
  53. ]);
  54. react2AngularDirective('metricSelect', MetricSelect, [
  55. 'options',
  56. 'onChange',
  57. 'value',
  58. 'isSearchable',
  59. 'className',
  60. 'placeholder',
  61. ['variables', { watchDepth: 'reference' }],
  62. ]);
  63. react2AngularDirective('stackdriverQueryEditor', StackdriverQueryEditor, [
  64. 'target',
  65. 'onQueryChange',
  66. 'onExecuteQuery',
  67. ['events', { watchDepth: 'reference' }],
  68. ['datasource', { watchDepth: 'reference' }],
  69. ['templateSrv', { watchDepth: 'reference' }],
  70. ]);
  71. react2AngularDirective('stackdriverAnnotationQueryEditor', StackdriverAnnotationQueryEditor, [
  72. 'target',
  73. 'onQueryChange',
  74. 'onExecuteQuery',
  75. ['datasource', { watchDepth: 'reference' }],
  76. ['templateSrv', { watchDepth: 'reference' }],
  77. ]);
  78. react2AngularDirective('secretFormField', SecretFormField, [
  79. 'value',
  80. 'isConfigured',
  81. 'inputWidth',
  82. 'labelWidth',
  83. ['onReset', { watchDepth: 'reference', wrapApply: true }],
  84. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  85. ]);
  86. react2AngularDirective('graphContextMenu', GraphContextMenu, [
  87. 'x',
  88. 'y',
  89. 'items',
  90. ['onClose', { watchDepth: 'reference', wrapApply: true }],
  91. ['getContextMenuSource', { watchDepth: 'reference', wrapApply: true }],
  92. ['formatSourceDate', { watchDepth: 'reference', wrapApply: true }],
  93. ]);
  94. // We keep the drilldown terminology here because of as using data-* directive
  95. // being in conflict with HTML data attributes
  96. react2AngularDirective('drilldownLinksEditor', DataLinksEditor, [
  97. 'value',
  98. 'suggestions',
  99. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  100. ]);
  101. react2AngularDirective('reactProfileWrapper', ReactProfileWrapper, []);
  102. }