mock-ide.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import getMeta from '../../../utils/meta'
  2. // When rendered without Angular, ide isn't defined. In that case we use
  3. // a mock object that only has the required properties to pass proptypes
  4. // checks and the values needed for the app. In the longer term, the mock
  5. // object will replace ide completely.
  6. export const getMockIde = () => {
  7. return {
  8. _id: getMeta('ol-project_id'),
  9. $scope: {
  10. $on: () => {},
  11. $watch: () => {},
  12. $applyAsync: () => {},
  13. user: {},
  14. project: {
  15. _id: getMeta('ol-project_id'),
  16. name: getMeta('ol-projectName'),
  17. rootDocId: '',
  18. members: [],
  19. invites: [],
  20. features: {
  21. collaborators: 0,
  22. compileGroup: 'standard',
  23. trackChangesVisible: false,
  24. references: false,
  25. mendeley: false,
  26. zotero: false,
  27. },
  28. publicAccessLevel: '',
  29. owner: {
  30. _id: '',
  31. email: '',
  32. },
  33. },
  34. permissionsLevel: 'readOnly',
  35. editor: {
  36. sharejs_doc: null,
  37. showSymbolPalette: false,
  38. toggleSymbolPalette: () => {},
  39. },
  40. ui: {
  41. view: 'pdf',
  42. chatOpen: false,
  43. reviewPanelOpen: false,
  44. leftMenuShown: false,
  45. pdfLayout: 'flat',
  46. },
  47. pdf: {
  48. uncompiled: true,
  49. logEntryAnnotations: {},
  50. },
  51. settings: { syntaxValidation: false, pdfViewer: 'pdfjs' },
  52. hasLintingError: false,
  53. },
  54. }
  55. }