angular_wrappers.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 } from '@grafana/ui';
  12. import { FunctionEditor } from 'app/plugins/datasource/graphite/FunctionEditor';
  13. import { SearchField } from './components/search/SearchField';
  14. export function registerAngularDirectives() {
  15. react2AngularDirective('passwordStrength', PasswordStrength, ['password']);
  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. }