helper.js 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. },
  48. loggedUser: { // @FIXME this object is outdated
  49. user_id: 1,
  50. username: 'Smoi',
  51. firstname: 'Côme',
  52. lastname: 'Stoilenom',
  53. email: 'osef@algoo.fr',
  54. avatar_url: 'https://avatars3.githubusercontent.com/u/11177014?s=460&v=4'
  55. },
  56. content: {
  57. author: {
  58. avatar_url: null,
  59. public_name: 'Global manager',
  60. user_id: 1 // -1 or 1 for debug
  61. },
  62. content_id: 48, // 1 or 22 for debug
  63. content_type: 'thread',
  64. created: '2018-06-18T14:59:26Z',
  65. current_revision_id: 11,
  66. is_archived: false,
  67. is_deleted: false,
  68. label: 'Current Menu',
  69. last_modifier: {
  70. avatar_url: null,
  71. public_name: 'Global manager',
  72. user_id: 1
  73. },
  74. modified: '2018-06-18T14:59:26Z',
  75. parent_id: 2,
  76. raw_content: '',
  77. show_in_ui: true,
  78. slug: 'current-menu',
  79. status: 'open',
  80. sub_content_types: ['thread', 'html-document', 'file', 'folder'],
  81. workspace_id: 1
  82. },
  83. timeline: [] // timelineDebugData
  84. }