angular_wrappers.ts 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 { PasswordStrength } from './components/PasswordStrength';
  5. import PageHeader from './components/PageHeader/PageHeader';
  6. import EmptyListCTA from './components/EmptyListCTA/EmptyListCTA';
  7. import { TagFilter } from './components/TagFilter/TagFilter';
  8. import { SideMenu } from './components/sidemenu/SideMenu';
  9. import { MetricSelect } from './components/Select/MetricSelect';
  10. import AppNotificationList from './components/AppNotifications/AppNotificationList';
  11. import { ColorPicker, SeriesColorPickerPopoverWithTheme, SecretFormField, DataLinksEditor } from '@grafana/ui';
  12. import { FunctionEditor } from 'app/plugins/datasource/graphite/FunctionEditor';
  13. import { SearchField } from './components/search/SearchField';
  14. import { GraphContextMenu } from 'app/plugins/panel/graph/GraphContextMenu';
  15. export function registerAngularDirectives() {
  16. react2AngularDirective('passwordStrength', PasswordStrength, ['password']);
  17. react2AngularDirective('sidemenu', SideMenu, []);
  18. react2AngularDirective('functionEditor', FunctionEditor, ['func', 'onRemove', 'onMoveLeft', 'onMoveRight']);
  19. react2AngularDirective('appNotificationsList', AppNotificationList, []);
  20. react2AngularDirective('pageHeader', PageHeader, ['model', 'noTabs']);
  21. react2AngularDirective('emptyListCta', EmptyListCTA, ['model']);
  22. react2AngularDirective('searchField', SearchField, [
  23. 'query',
  24. 'autoFocus',
  25. ['onChange', { watchDepth: 'reference' }],
  26. ['onKeyDown', { watchDepth: 'reference' }],
  27. ]);
  28. react2AngularDirective('tagFilter', TagFilter, [
  29. 'tags',
  30. ['onChange', { watchDepth: 'reference' }],
  31. ['tagOptions', { watchDepth: 'reference' }],
  32. ]);
  33. react2AngularDirective('colorPicker', ColorPicker, [
  34. 'color',
  35. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  36. ]);
  37. react2AngularDirective('seriesColorPickerPopover', SeriesColorPickerPopoverWithTheme, [
  38. 'color',
  39. 'series',
  40. 'onColorChange',
  41. 'onToggleAxis',
  42. ]);
  43. react2AngularDirective('metricSelect', MetricSelect, [
  44. 'options',
  45. 'onChange',
  46. 'value',
  47. 'isSearchable',
  48. 'className',
  49. 'placeholder',
  50. ['variables', { watchDepth: 'reference' }],
  51. ]);
  52. react2AngularDirective('stackdriverQueryEditor', StackdriverQueryEditor, [
  53. 'target',
  54. 'onQueryChange',
  55. 'onExecuteQuery',
  56. ['events', { watchDepth: 'reference' }],
  57. ['datasource', { watchDepth: 'reference' }],
  58. ['templateSrv', { watchDepth: 'reference' }],
  59. ]);
  60. react2AngularDirective('stackdriverAnnotationQueryEditor', StackdriverAnnotationQueryEditor, [
  61. 'target',
  62. 'onQueryChange',
  63. 'onExecuteQuery',
  64. ['datasource', { watchDepth: 'reference' }],
  65. ['templateSrv', { watchDepth: 'reference' }],
  66. ]);
  67. react2AngularDirective('secretFormField', SecretFormField, [
  68. 'value',
  69. 'isConfigured',
  70. 'inputWidth',
  71. 'labelWidth',
  72. ['onReset', { watchDepth: 'reference', wrapApply: true }],
  73. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  74. ]);
  75. react2AngularDirective('graphContextMenu', GraphContextMenu, [
  76. 'x',
  77. 'y',
  78. 'items',
  79. ['onClose', { watchDepth: 'reference', wrapApply: true }],
  80. ['getContextMenuSource', { 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. }