angular_wrappers.ts 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 { SearchResult } from './components/search/SearchResult';
  8. import { TagFilter } from './components/TagFilter/TagFilter';
  9. import { SideMenu } from './components/sidemenu/SideMenu';
  10. import { MetricSelect } from './components/Select/MetricSelect';
  11. import AppNotificationList from './components/AppNotifications/AppNotificationList';
  12. import { ColorPicker, SeriesColorPickerPopoverWithTheme, SecretFormField } from '@grafana/ui';
  13. import { FunctionEditor } from 'app/plugins/datasource/graphite/FunctionEditor';
  14. import { SearchField } from './components/search/SearchField';
  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('searchResult', SearchResult, []);
  23. react2AngularDirective('searchField', SearchField, [
  24. 'query',
  25. 'autoFocus',
  26. ['onChange', { watchDepth: 'reference' }],
  27. ['onKeyDown', { watchDepth: 'reference' }],
  28. ]);
  29. react2AngularDirective('tagFilter', TagFilter, [
  30. 'tags',
  31. ['onChange', { watchDepth: 'reference' }],
  32. ['tagOptions', { watchDepth: 'reference' }],
  33. ]);
  34. react2AngularDirective('colorPicker', ColorPicker, [
  35. 'color',
  36. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  37. ]);
  38. react2AngularDirective('seriesColorPickerPopover', SeriesColorPickerPopoverWithTheme, [
  39. 'color',
  40. 'series',
  41. 'onColorChange',
  42. 'onToggleAxis',
  43. ]);
  44. react2AngularDirective('metricSelect', MetricSelect, [
  45. 'options',
  46. 'onChange',
  47. 'value',
  48. 'isSearchable',
  49. 'className',
  50. 'placeholder',
  51. ['variables', { watchDepth: 'reference' }],
  52. ]);
  53. react2AngularDirective('stackdriverQueryEditor', StackdriverQueryEditor, [
  54. 'target',
  55. 'onQueryChange',
  56. 'onExecuteQuery',
  57. ['events', { watchDepth: 'reference' }],
  58. ['datasource', { watchDepth: 'reference' }],
  59. ['templateSrv', { watchDepth: 'reference' }],
  60. ]);
  61. react2AngularDirective('stackdriverAnnotationQueryEditor', StackdriverAnnotationQueryEditor, [
  62. 'target',
  63. 'onQueryChange',
  64. 'onExecuteQuery',
  65. ['datasource', { watchDepth: 'reference' }],
  66. ['templateSrv', { watchDepth: 'reference' }],
  67. ]);
  68. react2AngularDirective('secretFormField', SecretFormField, [
  69. 'value',
  70. 'isConfigured',
  71. 'inputWidth',
  72. 'labelWidth',
  73. ['onReset', { watchDepth: 'reference', wrapApply: true }],
  74. ['onChange', { watchDepth: 'reference', wrapApply: true }],
  75. ]);
  76. }