helper.js 2.4KB

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