initialData.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * initial data for the demo module
  3. **/
  4. /**
  5. * primary contains the primary data for the module.
  6. * It could come from a database, file or any other asynchronous source.
  7. * It can have joins from other databases directly in a field (e.g. joins)
  8. **/
  9. export const primary = [{
  10. id: 'primary-1',
  11. name: 'String1',
  12. active: true,
  13. items: [
  14. { id: 'item1-1' },
  15. { id: 'item1-2' }
  16. ],
  17. joins: [{
  18. id: 'id2',
  19. primaryId: 'primary-1',
  20. name: 'secondary1-2'
  21. }]
  22. }, {
  23. id: 'primary-2',
  24. name: 'String2',
  25. active: false,
  26. items: [
  27. { id: 'item2-1' },
  28. { id: 'item2-2' },
  29. { id: 'item2-3' },
  30. { id: 'item2-4' }
  31. ],
  32. joins: [{
  33. id: 'id1',
  34. primaryId: 'primary-2',
  35. name: 'secondary1-1'
  36. }, {
  37. id: 'id3',
  38. primaryId: 'primary-2',
  39. name: 'secondary1-3'
  40. }]
  41. }]
  42. /**
  43. * secondary contains the secondary data for the module.
  44. * It could come from a database, file or any other asynchronous source.
  45. * It is collected from the source and placed as reference in the primary data.
  46. * It should have a reference to the primary item it belongs to.
  47. **/
  48. export const secondary2 = [{
  49. id: 'id1',
  50. primaryId: 'primary-1',
  51. name: 'secondary2-1'
  52. }, {
  53. id: 'id2',
  54. primaryId: 'primary-2',
  55. name: 'secondary2-2'
  56. }, {
  57. id: 'id3',
  58. primaryId: 'primary-1',
  59. name: 'secondary2-3'
  60. }]