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. }
  7. }
  8. export const MODE = {
  9. VIEW: 'view',
  10. EDIT: 'edit',
  11. REVISION: 'revision'
  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. apiHeader: {
  23. 'Accept': 'application/json',
  24. 'Content-Type': 'application/json'
  25. // 'Authorization': 'Basic ' + btoa(`${'admin@admin.admin'}:${'admin@admin.admin'}`)
  26. },
  27. availableStatuses: [{
  28. label: 'Open',
  29. slug: 'open',
  30. faIcon: 'square-o',
  31. hexcolor: '#3f52e3',
  32. globalStatus: 'open'
  33. }, {
  34. label: 'Validated',
  35. slug: 'closed-validated',
  36. faIcon: 'check-square-o',
  37. hexcolor: '#008000',
  38. globalStatus: 'closed'
  39. }, {
  40. label: 'Cancelled',
  41. slug: 'closed-unvalidated',
  42. faIcon: 'close',
  43. hexcolor: '#f63434',
  44. globalStatus: 'closed'
  45. }, {
  46. label: 'Deprecated',
  47. slug: 'closed-deprecated',
  48. faIcon: 'warning',
  49. hexcolor: '#ababab',
  50. globalStatus: 'closed'
  51. }]
  52. },
  53. loggedUser: { // @FIXME this object is outdated
  54. user_id: 5,
  55. username: 'Smoi',
  56. firstname: 'Côme',
  57. lastname: 'Stoilenom',
  58. email: 'osef@algoo.fr',
  59. avatar_url: 'https://avatars3.githubusercontent.com/u/11177014?s=460&v=4',
  60. auth: btoa(`${'admin@admin.admin'}:${'admin@admin.admin'}`)
  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. }