testData.ts 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. import { DashboardSearchItemType, DashboardSection, DashboardSectionItem } from './types';
  2. function makeSection(sectionPartial: Partial<DashboardSection>): DashboardSection {
  3. return {
  4. title: 'Default title',
  5. id: Number.MAX_SAFE_INTEGER - 1,
  6. score: -99,
  7. expanded: true,
  8. type: DashboardSearchItemType.DashFolder,
  9. items: [],
  10. url: '/default-url',
  11. ...sectionPartial,
  12. };
  13. }
  14. const makeSectionItem = (itemPartial: Partial<DashboardSectionItem>): DashboardSectionItem => {
  15. return {
  16. id: Number.MAX_SAFE_INTEGER - 2,
  17. uid: 'default-uid',
  18. title: 'Default dashboard title',
  19. type: DashboardSearchItemType.DashDB,
  20. isStarred: false,
  21. tags: [],
  22. uri: 'db/default-slug',
  23. url: '/d/default-uid/default-slug',
  24. ...itemPartial,
  25. };
  26. };
  27. export const generalFolder: DashboardSection = {
  28. id: 0,
  29. title: 'General',
  30. items: [
  31. {
  32. id: 1,
  33. uid: 'lBdLINUWk',
  34. title: 'Test 1',
  35. uri: 'db/test1',
  36. url: '/d/lBdLINUWk/test1',
  37. type: DashboardSearchItemType.DashDB,
  38. tags: [],
  39. isStarred: false,
  40. checked: true,
  41. },
  42. {
  43. id: 46,
  44. uid: '8DY63kQZk',
  45. title: 'Test 2',
  46. uri: 'db/test2',
  47. url: '/d/8DY63kQZk/test2',
  48. type: DashboardSearchItemType.DashDB,
  49. tags: [],
  50. isStarred: false,
  51. checked: true,
  52. },
  53. ],
  54. icon: 'folder-open',
  55. score: 1,
  56. expanded: true,
  57. checked: false,
  58. url: '',
  59. type: DashboardSearchItemType.DashFolder,
  60. };
  61. export const searchResults: DashboardSection[] = [
  62. {
  63. id: 2,
  64. uid: 'JB_zdOUWk',
  65. title: 'gdev dashboards',
  66. expanded: false,
  67. items: [],
  68. url: '/dashboards/f/JB_zdOUWk/gdev-dashboards',
  69. icon: 'folder',
  70. score: 0,
  71. checked: true,
  72. type: DashboardSearchItemType.DashFolder,
  73. },
  74. generalFolder,
  75. ];
  76. // Search results with more info
  77. export const sections: DashboardSection[] = [
  78. makeSection({
  79. title: 'Starred',
  80. score: -2,
  81. expanded: true,
  82. items: [
  83. makeSectionItem({
  84. id: 1,
  85. uid: 'lBdLINUWk',
  86. title: 'Prom dash',
  87. type: DashboardSearchItemType.DashDB,
  88. }),
  89. ],
  90. }),
  91. makeSection({
  92. title: 'Recent',
  93. icon: 'clock-o',
  94. score: -1,
  95. expanded: false,
  96. items: [
  97. makeSectionItem({
  98. id: 4072,
  99. uid: 'OzAIf_rWz',
  100. title: 'New dashboard Copy 3',
  101. type: DashboardSearchItemType.DashDB,
  102. isStarred: false,
  103. }),
  104. makeSectionItem({
  105. id: 46,
  106. uid: '8DY63kQZk',
  107. title: 'Stocks',
  108. type: DashboardSearchItemType.DashDB,
  109. isStarred: false,
  110. }),
  111. makeSectionItem({
  112. id: 20,
  113. uid: '7MeksYbmk',
  114. title: 'Alerting with TestData',
  115. type: DashboardSearchItemType.DashDB,
  116. isStarred: false,
  117. folderId: 2,
  118. }),
  119. makeSectionItem({
  120. id: 4073,
  121. uid: 'j9SHflrWk',
  122. title: 'New dashboard Copy 4',
  123. type: DashboardSearchItemType.DashDB,
  124. isStarred: false,
  125. folderId: 2,
  126. }),
  127. ],
  128. }),
  129. makeSection({
  130. id: 2,
  131. uid: 'JB_zdOUWk',
  132. title: 'gdev dashboards',
  133. expanded: true,
  134. url: '/dashboards/f/JB_zdOUWk/gdev-dashboards',
  135. icon: 'folder',
  136. score: 2,
  137. items: [],
  138. }),
  139. makeSection({
  140. id: 2568,
  141. uid: 'search-test-data',
  142. title: 'Search test data folder',
  143. expanded: false,
  144. items: [],
  145. url: '/dashboards/f/search-test-data/search-test-data-folder',
  146. icon: 'folder',
  147. score: 3,
  148. }),
  149. makeSection({
  150. id: 4074,
  151. uid: 'iN5TFj9Zk',
  152. title: 'Test',
  153. expanded: false,
  154. items: [],
  155. url: '/dashboards/f/iN5TFj9Zk/test',
  156. icon: 'folder',
  157. score: 4,
  158. }),
  159. makeSection({
  160. id: 0,
  161. title: 'General',
  162. icon: 'folder-open',
  163. score: 5,
  164. expanded: true,
  165. items: [
  166. makeSectionItem({
  167. id: 4069,
  168. uid: 'LCFWfl9Zz',
  169. title: 'New dashboard Copy',
  170. uri: 'db/new-dashboard-copy',
  171. url: '/d/LCFWfl9Zz/new-dashboard-copy',
  172. type: DashboardSearchItemType.DashDB,
  173. isStarred: false,
  174. }),
  175. makeSectionItem({
  176. id: 4072,
  177. uid: 'OzAIf_rWz',
  178. title: 'New dashboard Copy 3',
  179. type: DashboardSearchItemType.DashDB,
  180. isStarred: false,
  181. }),
  182. makeSectionItem({
  183. id: 1,
  184. uid: 'lBdLINUWk',
  185. title: 'Prom dash',
  186. type: DashboardSearchItemType.DashDB,
  187. isStarred: true,
  188. }),
  189. ],
  190. }),
  191. ];
  192. export const checkedGeneralFolder: DashboardSection[] = [
  193. makeSection({
  194. id: 4074,
  195. uid: 'other-folder-dash',
  196. title: 'Test',
  197. expanded: false,
  198. type: DashboardSearchItemType.DashFolder,
  199. items: [
  200. makeSectionItem({
  201. id: 4072,
  202. uid: 'other-folder-dash-abc',
  203. title: 'New dashboard Copy 3',
  204. type: DashboardSearchItemType.DashDB,
  205. isStarred: false,
  206. }),
  207. makeSectionItem({
  208. id: 46,
  209. uid: 'other-folder-dash-def',
  210. title: 'Stocks',
  211. type: DashboardSearchItemType.DashDB,
  212. isStarred: false,
  213. }),
  214. ],
  215. url: '/dashboards/f/iN5TFj9Zk/test',
  216. icon: 'folder',
  217. score: 4,
  218. }),
  219. makeSection({
  220. id: 0,
  221. title: 'General',
  222. uid: 'other-folder-abc',
  223. score: 5,
  224. expanded: true,
  225. checked: true,
  226. type: DashboardSearchItemType.DashFolder,
  227. items: [
  228. makeSectionItem({
  229. id: 4069,
  230. uid: 'general-abc',
  231. title: 'New dashboard Copy',
  232. uri: 'db/new-dashboard-copy',
  233. url: '/d/LCFWfl9Zz/new-dashboard-copy',
  234. type: DashboardSearchItemType.DashDB,
  235. isStarred: false,
  236. checked: true,
  237. }),
  238. makeSectionItem({
  239. id: 4072,
  240. uid: 'general-def',
  241. title: 'New dashboard Copy 3',
  242. type: DashboardSearchItemType.DashDB,
  243. isStarred: false,
  244. checked: true,
  245. }),
  246. makeSectionItem({
  247. id: 1,
  248. uid: 'general-ghi',
  249. title: 'Prom dash',
  250. type: DashboardSearchItemType.DashDB,
  251. isStarred: true,
  252. checked: true,
  253. }),
  254. ],
  255. }),
  256. ];
  257. export const checkedOtherFolder: DashboardSection[] = [
  258. makeSection({
  259. id: 4074,
  260. uid: 'other-folder-abc',
  261. title: 'Test',
  262. expanded: false,
  263. checked: true,
  264. type: DashboardSearchItemType.DashFolder,
  265. items: [
  266. makeSectionItem({
  267. id: 4072,
  268. uid: 'other-folder-dash-abc',
  269. title: 'New dashboard Copy 3',
  270. type: DashboardSearchItemType.DashDB,
  271. isStarred: false,
  272. checked: true,
  273. }),
  274. makeSectionItem({
  275. id: 46,
  276. uid: 'other-folder-dash-def',
  277. title: 'Stocks',
  278. type: DashboardSearchItemType.DashDB,
  279. isStarred: false,
  280. checked: true,
  281. }),
  282. ],
  283. url: '/dashboards/f/iN5TFj9Zk/test',
  284. icon: 'folder',
  285. score: 4,
  286. }),
  287. makeSection({
  288. id: 0,
  289. title: 'General',
  290. icon: 'folder-open',
  291. score: 5,
  292. expanded: true,
  293. type: DashboardSearchItemType.DashFolder,
  294. items: [
  295. makeSectionItem({
  296. id: 4069,
  297. uid: 'general-abc',
  298. title: 'New dashboard Copy',
  299. uri: 'db/new-dashboard-copy',
  300. url: '/d/LCFWfl9Zz/new-dashboard-copy',
  301. type: DashboardSearchItemType.DashDB,
  302. isStarred: false,
  303. }),
  304. makeSectionItem({
  305. id: 4072,
  306. uid: 'general-def',
  307. title: 'New dashboard Copy 3',
  308. type: DashboardSearchItemType.DashDB,
  309. isStarred: false,
  310. }),
  311. makeSectionItem({
  312. id: 1,
  313. uid: 'general-ghi',
  314. title: 'Prom dash',
  315. type: DashboardSearchItemType.DashDB,
  316. isStarred: true,
  317. }),
  318. ],
  319. }),
  320. ];
  321. export const folderViewAllChecked: DashboardSection[] = [
  322. makeSection({
  323. checked: true,
  324. selected: true,
  325. title: '',
  326. items: [
  327. makeSectionItem({
  328. id: 4072,
  329. uid: 'other-folder-dash-abc',
  330. title: 'New dashboard Copy 3',
  331. type: DashboardSearchItemType.DashDB,
  332. isStarred: false,
  333. checked: true,
  334. }),
  335. makeSectionItem({
  336. id: 46,
  337. uid: 'other-folder-dash-def',
  338. title: 'Stocks',
  339. type: DashboardSearchItemType.DashDB,
  340. isStarred: false,
  341. checked: true,
  342. }),
  343. ],
  344. }),
  345. ];