helper.js 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. idRoleUserWorkspace: 1
  75. },
  76. content: {
  77. author: {
  78. avatar_url: null,
  79. public_name: 'Global manager',
  80. user_id: 1 // -1 or 1 for debug
  81. },
  82. content_id: 22, // 1 or 22 for debug
  83. content_type: 'html-document',
  84. created: '2018-06-18T14:59:26Z',
  85. current_revision_id: 11,
  86. is_archived: false,
  87. is_deleted: false,
  88. label: 'Current Menu',
  89. last_modifier: {
  90. avatar_url: null,
  91. public_name: 'Global manager',
  92. user_id: 1
  93. },
  94. modified: '2018-06-18T14:59:26Z',
  95. parent_id: 2,
  96. raw_content: '<div>bonjour, je suis un lapin.</div>',
  97. show_in_ui: true,
  98. slug: 'current-menu',
  99. status: 'open',
  100. sub_content_types: ['thread', 'html-document', 'file', 'folder'],
  101. workspace_id: 1
  102. },
  103. timeline: timelineDebugData
  104. }