mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-28 11:00:08 +02:00

* Move `hasLintingError` from scope to react state * Move `permissionsLevel` to IdeReactContext states * Get `permissionsLevel` from `useIdeReactContext()` * Set `permissionsLevel` in mocked `IdeReactProvider` * Replace `permissions` scope by React state * Fixup `permission` changes * Remove redundant type GitOrigin-RevId: 6203c61f9ac429789624196bf67e508310f4577f
49 lines
914 B
TypeScript
49 lines
914 B
TypeScript
import { MainDocument } from '../../../../types/project-settings'
|
|
import { PdfViewer } from '../../../../types/user-settings'
|
|
|
|
type Scope = {
|
|
settings?: {
|
|
syntaxValidation?: boolean
|
|
pdfViewer?: PdfViewer
|
|
}
|
|
editor?: {
|
|
sharejs_doc?: {
|
|
doc_id?: string
|
|
getSnapshot?: () => string
|
|
}
|
|
}
|
|
ui?: {
|
|
view?: 'editor' | 'history' | 'file' | 'pdf'
|
|
pdfLayout?: 'flat' | 'sideBySide' | 'split'
|
|
leftMenuShown?: boolean
|
|
}
|
|
project?: {
|
|
members?: any[]
|
|
owner: {
|
|
_id: string
|
|
}
|
|
features?: {
|
|
gitBridge?: boolean
|
|
}
|
|
}
|
|
user?: {
|
|
features?: {
|
|
dropbox: boolean
|
|
}
|
|
}
|
|
docs?: MainDocument[]
|
|
}
|
|
|
|
export const mockScope = (scope?: Scope) => ({
|
|
settings: {
|
|
syntaxValidation: false,
|
|
pdfViewer: 'pdfjs',
|
|
},
|
|
editor: {
|
|
sharejs_doc: {
|
|
doc_id: 'test-doc',
|
|
getSnapshot: () => 'some doc content',
|
|
},
|
|
},
|
|
...scope,
|
|
})
|