helper.js 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. availableStatuses: [{
  23. label: 'Open',
  24. slug: 'open',
  25. faIcon: 'square-o',
  26. hexcolor: '#3f52e3',
  27. globalStatus: 'open'
  28. }, {
  29. label: 'Validated',
  30. slug: 'closed-validated',
  31. faIcon: 'check-square-o',
  32. hexcolor: '#008000',
  33. globalStatus: 'closed'
  34. }, {
  35. label: 'Cancelled',
  36. slug: 'closed-unvalidated',
  37. faIcon: 'close',
  38. hexcolor: '#f63434',
  39. globalStatus: 'closed'
  40. }, {
  41. label: 'Deprecated',
  42. slug: 'closed-deprecated',
  43. faIcon: 'warning',
  44. hexcolor: '#ababab',
  45. globalStatus: 'closed'
  46. }],
  47. translation: {
  48. en: {
  49. translation: {
  50. 'Last version': 'Last version debug en'
  51. }
  52. },
  53. fr: {
  54. translation: {
  55. 'Last version': 'Dernière version debug fr'
  56. }
  57. }
  58. }
  59. },
  60. loggedUser: { // @FIXME this object is outdated
  61. user_id: 5,
  62. username: 'Smoi',
  63. firstname: 'Côme',
  64. lastname: 'Stoilenom',
  65. email: 'osef@algoo.fr',
  66. lang: 'en',
  67. avatar_url: 'https://avatars3.githubusercontent.com/u/11177014?s=460&v=4',
  68. auth: btoa(`${'admin@admin.admin'}:${'admin@admin.admin'}`),
  69. idRoleUserWorkspace: 1
  70. },
  71. content: {
  72. author: {
  73. avatar_url: null,
  74. public_name: 'Global manager',
  75. user_id: 1 // -1 or 1 for debug
  76. },
  77. content_id: 22, // 1 or 22 for debug
  78. content_type: 'html-document',
  79. created: '2018-06-18T14:59:26Z',
  80. current_revision_id: 11,
  81. is_archived: false,
  82. is_deleted: false,
  83. label: 'Current Menu',
  84. last_modifier: {
  85. avatar_url: null,
  86. public_name: 'Global manager',
  87. user_id: 1
  88. },
  89. modified: '2018-06-18T14:59:26Z',
  90. parent_id: 2,
  91. raw_content: '<div>bonjour, je suis un lapin.</div>',
  92. show_in_ui: true,
  93. slug: 'current-menu',
  94. status: 'open',
  95. sub_content_types: ['thread', 'html-document', 'file', 'folder'],
  96. workspace_id: 1
  97. },
  98. timeline: timelineDebugData
  99. }