Skip to content

Commit

Permalink
Merge pull request #1568 from merico-dev/1567-emotion-cache-is-not-av…
Browse files Browse the repository at this point in the history
…ailable-in-context-make-sure-that-you-have-mantineemotionprovider-in-the-component-tree

1567 emotion cache is not available in context make sure that you have mantineemotionprovider in the component tree
  • Loading branch information
GerilLeto authored Nov 11, 2024
2 parents e9e324b + e877355 commit 21c4f8f
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 87 deletions.
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/api",
"version": "13.43.9",
"version": "13.43.10",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/dashboard",
"version": "13.43.9",
"version": "13.43.10",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
Expand Down
105 changes: 54 additions & 51 deletions dashboard/src/dashboard-editor/dashboard-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { DashboardContentDBType, IDashboard } from '../types/dashboard';
import './dashboard-editor.css';
import { DashboardEditorHeader, DashboardEditorNavbar, EditorSpotlight, Settings } from './ui';
import { useLoadMonacoEditor } from './utils/load-monaco-editor';
import { MantineEmotionProvider } from '@mantine/emotion';

registerThemes();
registerECharts();
Expand Down Expand Up @@ -157,57 +158,59 @@ const _DashboardEditor = (
lang,
});
return (
<I18nextContextProvider lang={lang}>
<ModalsProvider>
<DatesProvider>
<DashboardThemeContextProvider value={{ searchButtonProps: config.searchButtonProps }}>
<DashboardModelContextProvider value={model}>
<ContentModelContextProvider value={model.content}>
<LayoutStateContext.Provider
value={{
inEditMode: true,
}}
>
<EditorSpotlight />
<PluginContext.Provider value={pluginContext}>
<ServiceLocatorProvider configure={configureServices}>
<AppShell
padding={0}
navbar={{
width: { base: 200, xs: 200, sm: 200, md: 220, lg: 240, xl: 260 },
breakpoint: 'xxs', //FIXME(leto): not sure
}}
styles={AppShellStyles}
>
<DashboardEditorHeader
onExit={onExit}
saveDashboardChanges={saveDashboardChanges}
headerSlot={headerSlot}
/>
<DashboardEditorNavbar />
<AppShell.Main>
<Box
className={`${className} dashboard-root`}
sx={{
position: 'relative',
}}
>
{model.content.views.visibleViews.map((view) => (
<DashboardViewEditor key={view.id} view={view} />
))}
</Box>
</AppShell.Main>
</AppShell>
<Settings />
</ServiceLocatorProvider>
</PluginContext.Provider>
</LayoutStateContext.Provider>
</ContentModelContextProvider>
</DashboardModelContextProvider>
</DashboardThemeContextProvider>
</DatesProvider>
</ModalsProvider>
</I18nextContextProvider>
<MantineEmotionProvider>
<I18nextContextProvider lang={lang}>
<ModalsProvider>
<DatesProvider>
<DashboardThemeContextProvider value={{ searchButtonProps: config.searchButtonProps }}>
<DashboardModelContextProvider value={model}>
<ContentModelContextProvider value={model.content}>
<LayoutStateContext.Provider
value={{
inEditMode: true,
}}
>
<EditorSpotlight />
<PluginContext.Provider value={pluginContext}>
<ServiceLocatorProvider configure={configureServices}>
<AppShell
padding={0}
navbar={{
width: { base: 200, xs: 200, sm: 200, md: 220, lg: 240, xl: 260 },
breakpoint: 'xxs', //FIXME(leto): not sure
}}
styles={AppShellStyles}
>
<DashboardEditorHeader
onExit={onExit}
saveDashboardChanges={saveDashboardChanges}
headerSlot={headerSlot}
/>
<DashboardEditorNavbar />
<AppShell.Main>
<Box
className={`${className} dashboard-root`}
sx={{
position: 'relative',
}}
>
{model.content.views.visibleViews.map((view) => (
<DashboardViewEditor key={view.id} view={view} />
))}
</Box>
</AppShell.Main>
</AppShell>
<Settings />
</ServiceLocatorProvider>
</PluginContext.Provider>
</LayoutStateContext.Provider>
</ContentModelContextProvider>
</DashboardModelContextProvider>
</DashboardThemeContextProvider>
</DatesProvider>
</ModalsProvider>
</I18nextContextProvider>
</MantineEmotionProvider>
);
};

Expand Down
65 changes: 34 additions & 31 deletions dashboard/src/dashboard-render/dashboard-render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { useTopLevelServices } from '../components/plugins/service/use-top-level
import { DashboardContentDBType, IDashboard } from '../types/dashboard';
import './dashboard-render.css';
import { createDashboardRenderModel } from './model';
import { MantineEmotionProvider } from '@mantine/emotion';

registerThemes();
registerECharts();
Expand Down Expand Up @@ -130,40 +131,42 @@ const _ReadOnlyDashboard = ({
lang,
});
return (
<I18nextContextProvider lang={lang}>
<ModalsProvider>
<DatesProvider>
<DashboardThemeContextProvider value={{ searchButtonProps: config.searchButtonProps }}>
<DashboardModelContextProvider value={model}>
<ContentModelContextProvider value={model.content}>
<FullScreenPanelContext.Provider
value={{
fullScreenPanelID,
setFullScreenPanelID,
}}
>
<LayoutStateContext.Provider
<MantineEmotionProvider>
<I18nextContextProvider lang={lang}>
<ModalsProvider>
<DatesProvider>
<DashboardThemeContextProvider value={{ searchButtonProps: config.searchButtonProps }}>
<DashboardModelContextProvider value={model}>
<ContentModelContextProvider value={model.content}>
<FullScreenPanelContext.Provider
value={{
inEditMode: false,
fullScreenPanelID,
setFullScreenPanelID,
}}
>
<Box className={`${className} dashboard-root`}>
<PluginContext.Provider value={pluginContext}>
<ServiceLocatorProvider configure={configureServices}>
{model.content.views.visibleViews.map((view) => (
<DashboardViewRender key={view.id} view={view} />
))}
</ServiceLocatorProvider>
</PluginContext.Provider>
</Box>
</LayoutStateContext.Provider>
</FullScreenPanelContext.Provider>
</ContentModelContextProvider>
</DashboardModelContextProvider>
</DashboardThemeContextProvider>
</DatesProvider>
</ModalsProvider>
</I18nextContextProvider>
<LayoutStateContext.Provider
value={{
inEditMode: false,
}}
>
<Box className={`${className} dashboard-root`}>
<PluginContext.Provider value={pluginContext}>
<ServiceLocatorProvider configure={configureServices}>
{model.content.views.visibleViews.map((view) => (
<DashboardViewRender key={view.id} view={view} />
))}
</ServiceLocatorProvider>
</PluginContext.Provider>
</Box>
</LayoutStateContext.Provider>
</FullScreenPanelContext.Provider>
</ContentModelContextProvider>
</DashboardModelContextProvider>
</DashboardThemeContextProvider>
</DatesProvider>
</ModalsProvider>
</I18nextContextProvider>
</MantineEmotionProvider>
);
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/root",
"version": "13.43.9",
"version": "13.43.10",
"private": true,
"workspaces": [
"api",
Expand Down
2 changes: 1 addition & 1 deletion settings-form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/settings-form",
"version": "13.43.9",
"version": "13.43.10",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@devtable/website",
"private": true,
"license": "Apache-2.0",
"version": "13.43.9",
"version": "13.43.10",
"scripts": {
"dev": "vite",
"preview": "vite preview"
Expand Down

0 comments on commit 21c4f8f

Please sign in to comment.