mock-ide.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. state: { loading: false },
  35. permissionsLevel: 'readOnly',
  36. editor: {
  37. sharejs_doc: null,
  38. showSymbolPalette: false,
  39. toggleSymbolPalette: () => {},
  40. },
  41. ui: {
  42. view: 'pdf',
  43. chatOpen: false,
  44. reviewPanelOpen: false,
  45. leftMenuShown: false,
  46. pdfLayout: 'flat',
  47. },
  48. pdf: {
  49. uncompiled: true,
  50. logEntryAnnotations: {},
  51. },
  52. settings: { syntaxValidation: false, pdfViewer: 'pdfjs' },
  53. hasLintingError: false,
  54. },
  55. editorManager: {
  56. openDoc: () => {},
  57. getCurrentDocumentId: () => {},
  58. },
  59. }
  60. }