helper.js 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import { timelineDebugData } from './timelineDebugData.js'
  2. export const FETCH_CONFIG = {
  3. headers: {
  4. 'Accept': 'application/json',
  5. 'Content-Type': 'application/json',
  6. 'Authorization': 'Basic ' + btoa(`${'admin@admin.admin'}:${'admin@admin.admin'}`)
  7. }
  8. }
  9. export const MODE = {
  10. VIEW: 'view',
  11. EDIT: 'edit',
  12. REVISION: 'revision'
  13. }
  14. export const debug = {
  15. config: {
  16. label: 'Text Document',
  17. slug: 'html-documents',
  18. faIcon: 'file-text-o',
  19. hexcolor: '#3f52e3',
  20. creationLabel: 'Write a document',
  21. domContainer: 'appContainer',
  22. apiUrl: 'http://localhost:6543/api/v2',
  23. mockApiUrl: 'http://localhost:3001',
  24. apiHeader: {
  25. 'Accept': 'application/json',
  26. 'Content-Type': 'application/json'
  27. // 'Authorization': 'Basic ' + btoa(`${'admin@admin.admin'}:${'admin@admin.admin'}`)
  28. },
  29. availableStatuses: [{
  30. label: 'Open',
  31. slug: 'open',
  32. faIcon: 'square-o',
  33. hexcolor: '#3f52e3',
  34. globalStatus: 'open'
  35. }, {
  36. label: 'Validated',
  37. slug: 'closed-validated',
  38. faIcon: 'check-square-o',
  39. hexcolor: '#008000',
  40. globalStatus: 'closed'
  41. }, {
  42. label: 'Cancelled',
  43. slug: 'closed-unvalidated',
  44. faIcon: 'close',
  45. hexcolor: '#f63434',
  46. globalStatus: 'closed'
  47. }, {
  48. label: 'Deprecated',
  49. slug: 'closed-deprecated',
  50. faIcon: 'warning',
  51. hexcolor: '#ababab',
  52. globalStatus: 'closed'
  53. }]
  54. },
  55. loggedUser: { // @FIXME this object is outdated
  56. user_id: 5,
  57. username: 'Smoi',
  58. firstname: 'Côme',
  59. lastname: 'Stoilenom',
  60. email: 'osef@algoo.fr',
  61. avatar_url: 'https://avatars3.githubusercontent.com/u/11177014?s=460&v=4'
  62. },
  63. content: {
  64. author: {
  65. avatar_url: null,
  66. public_name: 'Global manager',
  67. user_id: 1 // -1 or 1 for debug
  68. },
  69. content_id: 22, // 1 or 22 for debug
  70. content_type: 'html-documents',
  71. created: '2018-06-18T14:59:26Z',
  72. current_revision_id: 11,
  73. is_archived: false,
  74. is_deleted: false,
  75. label: 'Current Menu',
  76. last_modifier: {
  77. avatar_url: null,
  78. public_name: 'Global manager',
  79. user_id: 1
  80. },
  81. modified: '2018-06-18T14:59:26Z',
  82. parent_id: 2,
  83. raw_content: '<div>bonjour, je suis un lapin.</div>',
  84. show_in_ui: true,
  85. slug: 'current-menu',
  86. status: 'open',
  87. sub_content_types: ['thread', 'html-documents', 'file', 'folder'],
  88. workspace_id: 1
  89. },
  90. timeline: timelineDebugData
  91. }