helper.js 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. export const FETCH_CONFIG = {
  2. headers: {
  3. 'Accept': 'application/json',
  4. 'Content-Type': 'application/json'
  5. }
  6. }
  7. export const debug = { // copied from html-document => outdated
  8. config: {
  9. label: 'Thread',
  10. slug: 'thread',
  11. faIcon: 'comments-o',
  12. hexcolor: '#ad4cf9',
  13. creationLabel: 'Write a thread',
  14. domContainer: 'appFeatureContainer',
  15. apiUrl: 'http://localhost:6543/api/v2',
  16. mockApiUrl: 'http://localhost:3001',
  17. apiHeader: {
  18. 'Accept': 'application/json',
  19. 'Content-Type': 'application/json'
  20. // 'Authorization': 'Basic ' + btoa(`${'admin@admin.admin'}:${'admin@admin.admin'}`)
  21. },
  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: {en: {}, fr: {}}
  48. },
  49. loggedUser: { // @FIXME this object is outdated
  50. user_id: 1,
  51. username: 'Smoi',
  52. firstname: 'Côme',
  53. lastname: 'Stoilenom',
  54. email: 'osef@algoo.fr',
  55. avatar_url: 'https://avatars3.githubusercontent.com/u/11177014?s=460&v=4',
  56. auth: btoa(`${'admin@admin.admin'}:${'admin@admin.admin'}`),
  57. lang: 'en',
  58. idRoleUserWorkspace: 1
  59. },
  60. content: {
  61. author: {
  62. avatar_url: null,
  63. public_name: 'Global manager',
  64. user_id: 1 // -1 or 1 for debug
  65. },
  66. content_id: 48, // 1 or 22 for debug
  67. content_type: 'thread',
  68. created: '2018-06-18T14:59:26Z',
  69. current_revision_id: 11,
  70. is_archived: false,
  71. is_deleted: false,
  72. label: 'Current Menu',
  73. last_modifier: {
  74. avatar_url: null,
  75. public_name: 'Global manager',
  76. user_id: 1
  77. },
  78. modified: '2018-06-18T14:59:26Z',
  79. parent_id: 2,
  80. raw_content: '',
  81. show_in_ui: true,
  82. slug: 'current-menu',
  83. status: 'open',
  84. sub_content_types: ['thread', 'html-document', 'file', 'folder'],
  85. workspace_id: 1
  86. },
  87. timeline: [] // timelineDebugData
  88. }