helper.js 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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-document',
  17. faIcon: 'file-text-o',
  18. hexcolor: '#3f52e3',
  19. creationLabel: 'Write a document',
  20. domContainer: 'appFeatureContainer',
  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. translation: {
  53. en: {
  54. translation: {
  55. 'Last version': 'Last version debug en'
  56. }
  57. },
  58. fr: {
  59. translation: {
  60. 'Last version': 'Dernière version debug fr'
  61. }
  62. }
  63. }
  64. },
  65. loggedUser: { // @FIXME this object is outdated
  66. user_id: 5,
  67. username: 'Smoi',
  68. firstname: 'Côme',
  69. lastname: 'Stoilenom',
  70. email: 'osef@algoo.fr',
  71. lang: 'en',
  72. avatar_url: 'https://avatars3.githubusercontent.com/u/11177014?s=460&v=4',
  73. auth: btoa(`${'admin@admin.admin'}:${'admin@admin.admin'}`)
  74. },
  75. content: {
  76. author: {
  77. avatar_url: null,
  78. public_name: 'Global manager',
  79. user_id: 1 // -1 or 1 for debug
  80. },
  81. content_id: 22, // 1 or 22 for debug
  82. content_type: 'html-document',
  83. created: '2018-06-18T14:59:26Z',
  84. current_revision_id: 11,
  85. is_archived: false,
  86. is_deleted: false,
  87. label: 'Current Menu',
  88. last_modifier: {
  89. avatar_url: null,
  90. public_name: 'Global manager',
  91. user_id: 1
  92. },
  93. modified: '2018-06-18T14:59:26Z',
  94. parent_id: 2,
  95. raw_content: '<div>bonjour, je suis un lapin.</div>',
  96. show_in_ui: true,
  97. slug: 'current-menu',
  98. status: 'open',
  99. sub_content_types: ['thread', 'html-document', 'file', 'folder'],
  100. workspace_id: 1
  101. },
  102. timeline: timelineDebugData
  103. }