angular_wrappers.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. export function registerAngularDirectives() {
  15. react2AngularDirective('sidemenu', SideMenu, []);
  16. react2AngularDirective('functionEditor', FunctionEditor, ['func', 'onRemove', 'onMoveLeft', 'onMoveRight']);
  17. react2AngularDirective('appNotificationsList', AppNotificationList, []);
  18. react2AngularDirective('pageHeader', PageHeader, ['model', 'noTabs']);
  19. react2AngularDirective('emptyListCta', EmptyListCTA, ['model']);
  20. react2AngularDirective('searchField', SearchField, [
  21. 'query',
  22. 'autoFocus',
  23. ['onChange', { watchDepth: 'reference' }],
  24. ['onKeyDown', { watchDepth: 'reference' }],
  25. ]);
  26. react2AngularDirective('tagFilter', TagFilter, [
  27. 'tags',
  28. ['onChange', { watchDepth: 'reference' }],
  29. ['tagOptions', { watchDepth: 'reference' }],
  30. ]);
  31. react2AngularDirective('colorPicker', ColorPicker, [
  32. 'color',
  33. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  34. ]);
  35. react2AngularDirective('seriesColorPickerPopover', SeriesColorPickerPopoverWithTheme, [
  36. 'color',
  37. 'series',
  38. 'onColorChange',
  39. 'onToggleAxis',
  40. ]);
  41. react2AngularDirective('metricSelect', MetricSelect, [
  42. 'options',
  43. 'onChange',
  44. 'value',
  45. 'isSearchable',
  46. 'className',
  47. 'placeholder',
  48. ['variables', { watchDepth: 'reference' }],
  49. ]);
  50. react2AngularDirective('stackdriverQueryEditor', StackdriverQueryEditor, [
  51. 'target',
  52. 'onQueryChange',
  53. 'onExecuteQuery',
  54. ['events', { watchDepth: 'reference' }],
  55. ['datasource', { watchDepth: 'reference' }],
  56. ['templateSrv', { watchDepth: 'reference' }],
  57. ]);
  58. react2AngularDirective('stackdriverAnnotationQueryEditor', StackdriverAnnotationQueryEditor, [
  59. 'target',
  60. 'onQueryChange',
  61. 'onExecuteQuery',
  62. ['datasource', { watchDepth: 'reference' }],
  63. ['templateSrv', { watchDepth: 'reference' }],
  64. ]);
  65. react2AngularDirective('secretFormField', SecretFormField, [
  66. 'value',
  67. 'isConfigured',
  68. 'inputWidth',
  69. 'labelWidth',
  70. ['onReset', { watchDepth: 'reference', wrapApply: true }],
  71. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  72. ]);
  73. react2AngularDirective('graphContextMenu', GraphContextMenu, [
  74. 'x',
  75. 'y',
  76. 'items',
  77. ['onClose', { watchDepth: 'reference', wrapApply: true }],
  78. ['getContextMenuSource', { watchDepth: 'reference', wrapApply: true }],
  79. ['formatSourceDate', { watchDepth: 'reference', wrapApply: true }],
  80. ]);
  81. // We keep the drilldown terminology here because of as using data-* directive
  82. // being in conflict with HTML data attributes
  83. react2AngularDirective('drilldownLinksEditor', DataLinksEditor, [
  84. 'value',
  85. 'suggestions',
  86. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  87. ]);
  88. }