dashboardsAnalyticsEvents.tsx 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. // The add/edit widget modal is currently being ported to the widget builder full-page and
  2. // this will be removed once that is done.
  3. type DashboardsEventParametersAddWidgetModal = {
  4. 'dashboards_views.add_widget_modal.change': {
  5. field: string;
  6. from: string;
  7. value: string;
  8. widget_type: string;
  9. };
  10. 'dashboards_views.add_widget_modal.confirm': {
  11. data_set: string;
  12. };
  13. 'dashboards_views.add_widget_modal.opened': {};
  14. 'dashboards_views.add_widget_modal.save': {
  15. data_set: string;
  16. };
  17. 'dashboards_views.edit_widget_modal.confirm': {};
  18. 'dashboards_views.edit_widget_modal.opened': {};
  19. };
  20. const dashboardsEventMapAddWidgetModal: Record<
  21. keyof DashboardsEventParametersAddWidgetModal,
  22. string | null
  23. > = {
  24. 'dashboards_views.edit_widget_modal.confirm':
  25. 'Dashboards2: Edit Dashboard Widget modal form submitted',
  26. 'dashboards_views.edit_widget_modal.opened': 'Dashboards2: Edit Widget Modal Opened',
  27. 'dashboards_views.add_widget_modal.opened': 'Dashboards2: Add Widget Modal opened',
  28. 'dashboards_views.add_widget_modal.change':
  29. 'Dashboards2: Field changed in Add Widget Modal',
  30. 'dashboards_views.add_widget_modal.confirm':
  31. 'Dashboards2: Add Widget to Dashboard modal form submitted',
  32. 'dashboards_views.add_widget_modal.save':
  33. 'Dashboards2: Widget saved directly to Dashboard from Add Widget to Dashboard modal',
  34. };
  35. // Used in the full-page widget builder
  36. type DashboardsEventParametersWidgetBuilder = {
  37. 'dashboards_views.widget_builder.change': {
  38. field: string;
  39. from: string;
  40. new_widget: boolean;
  41. value: string;
  42. widget_type: string;
  43. };
  44. 'dashboards_views.widget_builder.opened': {
  45. new_widget: boolean;
  46. };
  47. 'dashboards_views.widget_builder.save': {
  48. data_set: string;
  49. new_widget: boolean;
  50. };
  51. };
  52. const dashboardsEventMapWidgetBuilder: Record<
  53. keyof DashboardsEventParametersWidgetBuilder,
  54. string | null
  55. > = {
  56. 'dashboards_views.widget_builder.change': 'Widget Builder: Field changed',
  57. 'dashboards_views.widget_builder.save': 'Widget Builder: Form submitted',
  58. 'dashboards_views.widget_builder.opened': 'Widget Builder: Page opened',
  59. };
  60. export type DashboardsEventParameters = {
  61. 'dashboards2.create.cancel': {};
  62. 'dashboards2.create.complete': {};
  63. 'dashboards2.delete': {};
  64. 'dashboards2.edit.cancel': {};
  65. 'dashboards2.edit.complete': {};
  66. 'dashboards2.edit.start': {};
  67. 'dashboards_manage.change_sort': {
  68. sort: string;
  69. };
  70. 'dashboards_manage.create.start': {};
  71. 'dashboards_manage.delete': {dashboard_id: number};
  72. 'dashboards_manage.duplicate': {dashboard_id: number};
  73. 'dashboards_manage.paginate': {};
  74. 'dashboards_manage.search': {};
  75. 'dashboards_manage.templates.add': {
  76. dashboard_id: string;
  77. dashboard_title: string;
  78. was_previewed: boolean;
  79. };
  80. 'dashboards_manage.templates.preview': {
  81. dashboard_id: string;
  82. };
  83. 'dashboards_manage.templates.toggle': {
  84. show_templates: boolean;
  85. };
  86. 'dashboards_views.open_in_discover.opened': {
  87. widget_type: string;
  88. };
  89. 'dashboards_views.query_selector.opened': {
  90. widget_type: string;
  91. };
  92. 'dashboards_views.query_selector.selected': {
  93. widget_type: string;
  94. };
  95. 'dashboards_views.widget_library.add': {
  96. num_widgets: number;
  97. };
  98. 'dashboards_views.widget_library.add_widget': {
  99. title: string;
  100. };
  101. 'dashboards_views.widget_library.opened': {};
  102. 'dashboards_views.widget_library.switch_tab': {
  103. to: string;
  104. };
  105. 'dashboards_views.widget_viewer.edit': {
  106. display_type: string;
  107. widget_type: string;
  108. };
  109. 'dashboards_views.widget_viewer.open': {
  110. display_type: string;
  111. widget_type: string;
  112. };
  113. 'dashboards_views.widget_viewer.open_source': {
  114. display_type: string;
  115. widget_type: string;
  116. };
  117. 'dashboards_views.widget_viewer.paginate': {
  118. display_type: string;
  119. widget_type: string;
  120. };
  121. 'dashboards_views.widget_viewer.select_query': {
  122. display_type: string;
  123. widget_type: string;
  124. };
  125. 'dashboards_views.widget_viewer.sort': {
  126. column: string;
  127. display_type: string;
  128. order: string;
  129. widget_type: string;
  130. };
  131. 'dashboards_views.widget_viewer.toggle_legend': {
  132. display_type: string;
  133. widget_type: string;
  134. };
  135. 'dashboards_views.widget_viewer.zoom': {
  136. display_type: string;
  137. widget_type: string;
  138. };
  139. } & DashboardsEventParametersAddWidgetModal &
  140. DashboardsEventParametersWidgetBuilder;
  141. export type DashboardsEventKey = keyof DashboardsEventParameters;
  142. export const dashboardsEventMap: Record<DashboardsEventKey, string | null> = {
  143. 'dashboards2.create.cancel': 'Dashboards2: Create cancel',
  144. 'dashboards2.create.complete': 'Dashboards2: Create complete',
  145. 'dashboards2.delete': 'Dashboards2: Delete',
  146. 'dashboards2.edit.cancel': 'Dashboards2: Edit cancel',
  147. 'dashboards2.edit.complete': 'Dashboards2: Edit complete',
  148. 'dashboards2.edit.start': 'Dashboards2: Edit start',
  149. 'dashboards_views.query_selector.opened':
  150. 'Dashboards2: Query Selector opened for Widget',
  151. 'dashboards_views.query_selector.selected':
  152. 'Dashboards2: Query selected in Query Selector',
  153. 'dashboards_views.open_in_discover.opened': 'Dashboards2: Widget Opened In Discover',
  154. 'dashboards_views.widget_library.add': 'Dashboards2: Number of prebuilt widgets added',
  155. 'dashboards_views.widget_library.add_widget':
  156. 'Dashboards2: Title of prebuilt widget added',
  157. 'dashboards_views.widget_library.switch_tab':
  158. 'Dashboards2: Widget Library tab switched',
  159. 'dashboards_views.widget_library.opened': 'Dashboards2: Add Widget Library opened',
  160. 'dashboards_manage.search': 'Dashboards Manager: Search',
  161. 'dashboards_manage.change_sort': 'Dashboards Manager: Sort By Changed',
  162. 'dashboards_manage.create.start': 'Dashboards Manager: Dashboard Create Started',
  163. 'dashboards_manage.delete': 'Dashboards Manager: Dashboard Deleted',
  164. 'dashboards_manage.duplicate': 'Dashboards Manager: Dashboard Duplicated',
  165. 'dashboards_manage.paginate': 'Dashboards Manager: Paginate',
  166. 'dashboards_manage.templates.toggle': 'Dashboards Manager: Template Toggle Changed',
  167. 'dashboards_manage.templates.add': 'Dashboards Manager: Template Added',
  168. 'dashboards_manage.templates.preview': 'Dashboards Manager: Template Previewed',
  169. 'dashboards_views.widget_viewer.edit': 'Widget Viewer: Edit Widget Modal Opened',
  170. 'dashboards_views.widget_viewer.open': 'Widget Viewer: Opened',
  171. 'dashboards_views.widget_viewer.open_source':
  172. 'Widget Viewer: Opened in Discover/Issues',
  173. 'dashboards_views.widget_viewer.paginate': 'Widget Viewer: Paginate',
  174. 'dashboards_views.widget_viewer.select_query': 'Widget Viewer: Query Selected',
  175. 'dashboards_views.widget_viewer.sort': 'Widget Viewer: Table Sorted',
  176. 'dashboards_views.widget_viewer.toggle_legend': 'Widget Viewer: Legend Toggled',
  177. 'dashboards_views.widget_viewer.zoom': 'Widget Viewer: Chart zoomed',
  178. ...dashboardsEventMapAddWidgetModal,
  179. ...dashboardsEventMapWidgetBuilder,
  180. };