2021-04-30 16:20:16 -04:00
|
|
|
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,
|
|
|
|
},
|
2021-05-14 04:26:20 -04:00
|
|
|
features: {
|
|
|
|
compileGroup: 'standard',
|
|
|
|
},
|
2021-04-30 16:20:16 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<ApplicationProvider>
|
|
|
|
<EditorProvider ide={ide} settings={{}}>
|
|
|
|
<PreviewLogsPane {...args} />
|
|
|
|
</EditorProvider>
|
|
|
|
</ApplicationProvider>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
TimedOutError.args = {
|
|
|
|
errors: {
|
|
|
|
timedout: {},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-05-14 04:26:20 -04:00
|
|
|
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: {},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-04-30 16:20:16 -04:00
|
|
|
export default {
|
|
|
|
title: 'Preview Logs / Pane',
|
|
|
|
component: PreviewLogsPane,
|
|
|
|
argTypes: {
|
|
|
|
onLogEntryLocationClick: { action: 'log entry location' },
|
|
|
|
onClearCache: { action: 'clear cache' },
|
|
|
|
},
|
|
|
|
}
|