mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
[web] Fix Editor Stories (#26535)
* Fix storybook stories * Add `chat` to `ol-capabilities` in Storybook GitOrigin-RevId: 0816c82170ebc3bfe9ca2d7f02766364c693365a
This commit is contained in:
@@ -13,6 +13,12 @@ import en from '../../../services/web/locales/en.json'
|
|||||||
function resetMeta() {
|
function resetMeta() {
|
||||||
window.metaAttributesCache = new Map()
|
window.metaAttributesCache = new Map()
|
||||||
window.metaAttributesCache.set('ol-i18n', { currentLangCode: 'en' })
|
window.metaAttributesCache.set('ol-i18n', { currentLangCode: 'en' })
|
||||||
|
window.metaAttributesCache.set('ol-projectHistoryBlobsEnabled', true)
|
||||||
|
window.metaAttributesCache.set('ol-capabilities', ['chat'])
|
||||||
|
window.metaAttributesCache.set('ol-compileSettings', {
|
||||||
|
reducedTimeoutWarning: 'default',
|
||||||
|
compileTimeout: 20,
|
||||||
|
})
|
||||||
window.metaAttributesCache.set('ol-ExposedSettings', {
|
window.metaAttributesCache.set('ol-ExposedSettings', {
|
||||||
adminEmail: 'placeholder@example.com',
|
adminEmail: 'placeholder@example.com',
|
||||||
appName: 'Overleaf',
|
appName: 'Overleaf',
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ const setupFetchMock = fetchMock => {
|
|||||||
const fileData = {
|
const fileData = {
|
||||||
id: 'file-id',
|
id: 'file-id',
|
||||||
name: 'file.tex',
|
name: 'file.tex',
|
||||||
|
hash: 'c0ffee',
|
||||||
created: new Date().toISOString(),
|
created: new Date().toISOString(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export const mockClearCache = fetchMock =>
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const mockBuildFile = fetchMock =>
|
export const mockBuildFile = fetchMock =>
|
||||||
fetchMock.get('express:/build/:file', url => {
|
fetchMock.get('express:/build/:file', ({ url }) => {
|
||||||
const { pathname } = new URL(url, 'https://example.com')
|
const { pathname } = new URL(url, 'https://example.com')
|
||||||
|
|
||||||
switch (pathname) {
|
switch (pathname) {
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ export const HybridToolbar = () => {
|
|||||||
|
|
||||||
export const FileList = () => {
|
export const FileList = () => {
|
||||||
const fileList = useMemo(() => {
|
const fileList = useMemo(() => {
|
||||||
return buildFileList(cloneDeep(outputFiles))
|
return buildFileList(cloneDeep(outputFiles), {})
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -189,6 +189,9 @@ const mockDoc = (content: string, changes: Array<Record<string, any>> = []) => {
|
|||||||
detachFromCM6: () => {
|
detachFromCM6: () => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
},
|
},
|
||||||
|
getType: () => {
|
||||||
|
return 'history-ot'
|
||||||
|
},
|
||||||
on: () => {
|
on: () => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user