mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-25 09:21:32 +00:00
01c8a8a04d
Only show upgrade message on timeout if not already premium GitOrigin-RevId: 1378b0a98c6b511d63f2ce1192d3fdca16e8db26
80 lines
1.7 KiB
JavaScript
80 lines
1.7 KiB
JavaScript
import React from 'react'
|
|
import PreviewLogsPane from '../js/features/preview/components/preview-logs-pane'
|
|
import { EditorProvider } from '../js/shared/context/editor-context'
|
|
import { ApplicationProvider } from '../js/shared/context/application-context'
|
|
import useFetchMock from './hooks/use-fetch-mock'
|
|
|
|
export const TimedOutError = args => {
|
|
useFetchMock(fetchMock => {
|
|
fetchMock.post('express:/event/:key', 202)
|
|
})
|
|
|
|
const ide = {
|
|
$scope: {
|
|
$watch: () => () => null,
|
|
project: {
|
|
owner: {
|
|
_id: window.user.id,
|
|
},
|
|
features: {
|
|
compileGroup: 'standard',
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
return (
|
|
<ApplicationProvider>
|
|
<EditorProvider ide={ide} settings={{}}>
|
|
<PreviewLogsPane {...args} />
|
|
</EditorProvider>
|
|
</ApplicationProvider>
|
|
)
|
|
}
|
|
TimedOutError.args = {
|
|
errors: {
|
|
timedout: {},
|
|
},
|
|
}
|
|
|
|
export const TimedOutErrorWithPriorityCompile = args => {
|
|
useFetchMock(fetchMock => {
|
|
fetchMock.post('express:/event/:key', 202)
|
|
})
|
|
|
|
const ide = {
|
|
$scope: {
|
|
$watch: () => () => null,
|
|
project: {
|
|
owner: {
|
|
_id: window.user.id,
|
|
},
|
|
features: {
|
|
compileGroup: 'priority',
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
return (
|
|
<ApplicationProvider>
|
|
<EditorProvider ide={ide} settings={{}}>
|
|
<PreviewLogsPane {...args} />
|
|
</EditorProvider>
|
|
</ApplicationProvider>
|
|
)
|
|
}
|
|
TimedOutErrorWithPriorityCompile.args = {
|
|
errors: {
|
|
timedout: {},
|
|
},
|
|
}
|
|
|
|
export default {
|
|
title: 'Preview Logs / Pane',
|
|
component: PreviewLogsPane,
|
|
argTypes: {
|
|
onLogEntryLocationClick: { action: 'log entry location' },
|
|
onClearCache: { action: 'clear cache' },
|
|
},
|
|
}
|