helper.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. export const FETCH_CONFIG = {
  2. headers: {
  3. 'Accept': 'application/json',
  4. 'Content-Type': 'application/json'
  5. },
  6. apiUrl: 'http://localhost:6543/api/v2',
  7. mockApiUrl: 'http://localhost:3001' // @todo: better to use one url only and use proxy on mock api to point to real api (if implemented)
  8. }
  9. export const COOKIE = {
  10. USER_LOGIN: 'user_login',
  11. USER_AUTH: 'user_auth'
  12. }
  13. export const PAGE = {
  14. HOME: '/',
  15. WORKSPACE: {
  16. DASHBOARD: (idws = ':idws') => `/workspaces/${idws}/dashboard`,
  17. NEW: (idws, type) => `/workspaces/${idws}/${type}/new`,
  18. CALENDAR: (idws = ':idws') => `/workspaces/${idws}/calendar`,
  19. CONTENT_LIST: (idws = ':idws') => `/workspaces/${idws}/contents`,
  20. CONTENT: (idws = ':idws', type = ':type?', idcts = ':idcts?') => `/workspaces/${idws}/${type}/${idcts}`, // @TODO add /contents/ in url and remove <Switch> in <Tracim>
  21. // CONTENT_NEW: (idws = ':idws', ctstype = ':ctstype') => `/workspaces/${idws}/contents/${ctstype}/new`,
  22. // CONTENT_EDIT: (idws = ':idws', idcts = ':idcts') => `/workspaces/${idws}/contents/${idcts}/edit`,
  23. // CONTENT_TITLE_EDIT: (idws = ':idws', idcts = ':idcts') => `/workspaces/${idws}/contents/${idcts}/title/edit`,
  24. ADMIN: (idws = ':idws') => `/workspaces/${idws}/admin`
  25. },
  26. LOGIN: '/login',
  27. ACCOUNT: '/account'
  28. }
  29. export const ROLE = [{
  30. id: 0,
  31. name: 'reader',
  32. icon: 'fa-eye',
  33. translationKey: 'role.reader'
  34. }, {
  35. id: 1,
  36. name: 'contributor',
  37. icon: 'fa-pencil',
  38. translationKey: 'role.contributor'
  39. }, {
  40. id: 2,
  41. name: 'content_manager',
  42. icon: 'fa-graduation-cap',
  43. translationKey: 'role.content_manager'
  44. }, {
  45. id: 3,
  46. name: 'manager',
  47. icon: 'fa-gavel',
  48. translationKey: 'role.manager'
  49. }]