diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2023-03-31 17:31:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 17:31:46 +0200 |
commit | 93f1d439f33a5139039fe93280bbfcae61a904ab (patch) | |
tree | e98eae681a866d2d0cd728885ed6c8f8fa65e9a2 /subprojects/frontend/src | |
parent | refactor: PartialInterpretation adapter naming (diff) | |
parent | build: try to fix secret detection in workflow (diff) | |
download | refinery-93f1d439f33a5139039fe93280bbfcae61a904ab.tar.gz refinery-93f1d439f33a5139039fe93280bbfcae61a904ab.tar.zst refinery-93f1d439f33a5139039fe93280bbfcae61a904ab.zip |
Merge pull request #24 from kris7t/partial-interpretation
Changes for supporting partial interpretation
Diffstat (limited to 'subprojects/frontend/src')
-rw-r--r-- | subprojects/frontend/src/Refinery.tsx | 1 | ||||
-rw-r--r-- | subprojects/frontend/src/UpdateNotification.tsx | 4 | ||||
-rw-r--r-- | subprojects/frontend/src/editor/scrollbarViewPlugin.ts | 1 | ||||
-rw-r--r-- | subprojects/frontend/src/theme/ThemeProvider.tsx | 8 | ||||
-rw-r--r-- | subprojects/frontend/src/utils/PendingTask.ts | 1 | ||||
-rw-r--r-- | subprojects/frontend/src/utils/useDelayedSnackbar.ts | 1 | ||||
-rw-r--r-- | subprojects/frontend/src/xtext/webSocketMachine.ts | 11 |
7 files changed, 10 insertions, 17 deletions
diff --git a/subprojects/frontend/src/Refinery.tsx b/subprojects/frontend/src/Refinery.tsx index 93a82ee1..f0162349 100644 --- a/subprojects/frontend/src/Refinery.tsx +++ b/subprojects/frontend/src/Refinery.tsx | |||
@@ -8,7 +8,6 @@ import EditorPane from './editor/EditorPane'; | |||
8 | 8 | ||
9 | export default function Refinery(): JSX.Element { | 9 | export default function Refinery(): JSX.Element { |
10 | return ( | 10 | return ( |
11 | // @ts-expect-error -- notistack has problems with `exactOptionalPropertyTypes | ||
12 | <SnackbarProvider TransitionComponent={Grow}> | 11 | <SnackbarProvider TransitionComponent={Grow}> |
13 | <UpdateNotification /> | 12 | <UpdateNotification /> |
14 | <Stack direction="column" height="100%" overflow="auto"> | 13 | <Stack direction="column" height="100%" overflow="auto"> |
diff --git a/subprojects/frontend/src/UpdateNotification.tsx b/subprojects/frontend/src/UpdateNotification.tsx index 07f7f5f7..5c8c2d01 100644 --- a/subprojects/frontend/src/UpdateNotification.tsx +++ b/subprojects/frontend/src/UpdateNotification.tsx | |||
@@ -32,14 +32,14 @@ export default observer(function UpdateNotification(): null { | |||
32 | return enqueueLater('Failed to download update', { | 32 | return enqueueLater('Failed to download update', { |
33 | variant: 'error', | 33 | variant: 'error', |
34 | action: ( | 34 | action: ( |
35 | <> | 35 | <ContrastThemeProvider> |
36 | <Button color="inherit" onClick={() => pwaStore.checkForUpdates()}> | 36 | <Button color="inherit" onClick={() => pwaStore.checkForUpdates()}> |
37 | Try again | 37 | Try again |
38 | </Button> | 38 | </Button> |
39 | <Button color="inherit" onClick={() => pwaStore.dismissError()}> | 39 | <Button color="inherit" onClick={() => pwaStore.dismissError()}> |
40 | Dismiss | 40 | Dismiss |
41 | </Button> | 41 | </Button> |
42 | </> | 42 | </ContrastThemeProvider> |
43 | ), | 43 | ), |
44 | }); | 44 | }); |
45 | } | 45 | } |
diff --git a/subprojects/frontend/src/editor/scrollbarViewPlugin.ts b/subprojects/frontend/src/editor/scrollbarViewPlugin.ts index f54251a9..f44034fd 100644 --- a/subprojects/frontend/src/editor/scrollbarViewPlugin.ts +++ b/subprojects/frontend/src/editor/scrollbarViewPlugin.ts | |||
@@ -266,7 +266,6 @@ export default function scrollbarViewPlugin( | |||
266 | if (firstRunTimeout !== undefined) { | 266 | if (firstRunTimeout !== undefined) { |
267 | clearTimeout(firstRunTimeout); | 267 | clearTimeout(firstRunTimeout); |
268 | } | 268 | } |
269 | // @ts-expect-error `@types/node` typings should not be in effect here. | ||
270 | firstRunTimeout = setTimeout(() => { | 269 | firstRunTimeout = setTimeout(() => { |
271 | spacer.style.minHeight = `${scrollHeight}px`; | 270 | spacer.style.minHeight = `${scrollHeight}px`; |
272 | firstRun = false; | 271 | firstRun = false; |
diff --git a/subprojects/frontend/src/theme/ThemeProvider.tsx b/subprojects/frontend/src/theme/ThemeProvider.tsx index 7bda1ede..ff97d524 100644 --- a/subprojects/frontend/src/theme/ThemeProvider.tsx +++ b/subprojects/frontend/src/theme/ThemeProvider.tsx | |||
@@ -6,7 +6,6 @@ import { | |||
6 | type ThemeOptions, | 6 | type ThemeOptions, |
7 | ThemeProvider as MaterialUiThemeProvider, | 7 | ThemeProvider as MaterialUiThemeProvider, |
8 | type TypographyStyle, | 8 | type TypographyStyle, |
9 | useTheme, | ||
10 | type CSSObject, | 9 | type CSSObject, |
11 | } from '@mui/material/styles'; | 10 | } from '@mui/material/styles'; |
12 | import { observer } from 'mobx-react-lite'; | 11 | import { observer } from 'mobx-react-lite'; |
@@ -350,15 +349,14 @@ export function ContrastThemeProvider({ | |||
350 | }: { | 349 | }: { |
351 | children?: ReactNode; | 350 | children?: ReactNode; |
352 | }): JSX.Element { | 351 | }): JSX.Element { |
353 | const theme = useTheme(); | ||
354 | const contrastTheme = useContext(ContrastThemeContext); | 352 | const contrastTheme = useContext(ContrastThemeContext); |
355 | if (!contrastTheme) { | 353 | if (!contrastTheme) { |
356 | throw new Error('ContrastThemeProvider must be used within ThemeProvider'); | 354 | throw new Error('ContrastThemeProvider must be used within ThemeProvider'); |
357 | } | 355 | } |
358 | return ( | 356 | return ( |
359 | <ThemeAndContrastThemeProvider theme={contrastTheme} contrastTheme={theme}> | 357 | <MaterialUiThemeProvider theme={contrastTheme}> |
360 | {children} | 358 | {children} |
361 | </ThemeAndContrastThemeProvider> | 359 | </MaterialUiThemeProvider> |
362 | ); | 360 | ); |
363 | } | 361 | } |
364 | 362 | ||
@@ -378,7 +376,7 @@ const ThemeProvider = observer(function ThemeProvider({ | |||
378 | return ( | 376 | return ( |
379 | <ThemeAndContrastThemeProvider | 377 | <ThemeAndContrastThemeProvider |
380 | theme={darkMode ? darkTheme : lightTheme} | 378 | theme={darkMode ? darkTheme : lightTheme} |
381 | contrastTheme={darkMode ? lightTheme : darkTheme} | 379 | contrastTheme={darkTheme} |
382 | > | 380 | > |
383 | {children} | 381 | {children} |
384 | </ThemeAndContrastThemeProvider> | 382 | </ThemeAndContrastThemeProvider> |
diff --git a/subprojects/frontend/src/utils/PendingTask.ts b/subprojects/frontend/src/utils/PendingTask.ts index fd52cef1..d0b24c1f 100644 --- a/subprojects/frontend/src/utils/PendingTask.ts +++ b/subprojects/frontend/src/utils/PendingTask.ts | |||
@@ -20,7 +20,6 @@ export default class PendingTask<T> { | |||
20 | ) { | 20 | ) { |
21 | this.resolveCallback = resolveCallback; | 21 | this.resolveCallback = resolveCallback; |
22 | this.rejectCallback = rejectCallback; | 22 | this.rejectCallback = rejectCallback; |
23 | // @ts-expect-error See https://github.com/mobxjs/mobx/issues/3582 on `@types/node` pollution | ||
24 | this.timeout = setTimeout(() => { | 23 | this.timeout = setTimeout(() => { |
25 | if (!this.resolved) { | 24 | if (!this.resolved) { |
26 | this.reject(new TimeoutError()); | 25 | this.reject(new TimeoutError()); |
diff --git a/subprojects/frontend/src/utils/useDelayedSnackbar.ts b/subprojects/frontend/src/utils/useDelayedSnackbar.ts index 54716c0c..03ad6caa 100644 --- a/subprojects/frontend/src/utils/useDelayedSnackbar.ts +++ b/subprojects/frontend/src/utils/useDelayedSnackbar.ts | |||
@@ -21,7 +21,6 @@ export default function useDelayedSnackbar( | |||
21 | delay = defaultDelay, | 21 | delay = defaultDelay, |
22 | ) => { | 22 | ) => { |
23 | let key: SnackbarKey | undefined; | 23 | let key: SnackbarKey | undefined; |
24 | // @ts-expect-error See https://github.com/mobxjs/mobx/issues/3582 on `@types/node` pollution | ||
25 | let timeout: number | undefined = setTimeout(() => { | 24 | let timeout: number | undefined = setTimeout(() => { |
26 | timeout = undefined; | 25 | timeout = undefined; |
27 | key = enqueueSnackbar(message, options); | 26 | key = enqueueSnackbar(message, options); |
diff --git a/subprojects/frontend/src/xtext/webSocketMachine.ts b/subprojects/frontend/src/xtext/webSocketMachine.ts index 216ed86a..fc53fef3 100644 --- a/subprojects/frontend/src/xtext/webSocketMachine.ts +++ b/subprojects/frontend/src/xtext/webSocketMachine.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import ms from 'ms'; | 1 | import ms from 'ms'; |
2 | import { actions, assign, createMachine, RaiseAction } from 'xstate'; | 2 | import { actions, assign, createMachine } from 'xstate'; |
3 | 3 | ||
4 | const { raise } = actions; | 4 | const { raise } = actions; |
5 | 5 | ||
@@ -217,16 +217,15 @@ export default createMachine( | |||
217 | ...context, | 217 | ...context, |
218 | errors: [], | 218 | errors: [], |
219 | })), | 219 | })), |
220 | // Workaround from https://github.com/statelyai/xstate/issues/1414#issuecomment-699972485 | ||
221 | raiseTimeoutError: raise({ | 220 | raiseTimeoutError: raise({ |
222 | type: 'ERROR', | 221 | type: 'ERROR', |
223 | message: 'Open timeout', | 222 | message: 'Open timeout', |
224 | }) as RaiseAction<WebSocketEvent>, | 223 | }), |
225 | raisePromiseRejectionError: (_context, { data }) => | 224 | raisePromiseRejectionError: (_context, { data }) => |
226 | raise({ | 225 | raise<WebSocketContext, WebSocketEvent>({ |
227 | type: 'ERROR', | 226 | type: 'ERROR', |
228 | message: data, | 227 | message: String(data), |
229 | }) as RaiseAction<WebSocketEvent>, | 228 | }), |
230 | }, | 229 | }, |
231 | }, | 230 | }, |
232 | ); | 231 | ); |