Merge remote-tracking branch 'origin/feature' into feature
# Conflicts: # .idea/modules.xml
This commit is contained in:
4
.idea/modules.xml
generated
4
.idea/modules.xml
generated
@@ -2,6 +2,10 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/backend-api/backend-api.iml" filepath="$PROJECT_DIR$/backend-api/backend-api.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/backend-libs-lambda-layer/backend-libs-lambda-layer.iml" filepath="$PROJECT_DIR$/backend-libs-lambda-layer/backend-libs-lambda-layer.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/frontend-web/frontend-web.iml" filepath="$PROJECT_DIR$/frontend-web/frontend-web.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/landing-page/landing-page.iml" filepath="$PROJECT_DIR$/landing-page/landing-page.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/vanillameta.iml" filepath="$PROJECT_DIR$/.idea/vanillameta.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useContext, useEffect, useState } from 'react';
|
||||
import { Stack, Typography } from '@mui/material';
|
||||
import { Box, Stack, Typography } from '@mui/material';
|
||||
import { WIDGET_TYPE } from '@/constant';
|
||||
import LineChart from '@/widget/modules/linechart/LineChart';
|
||||
import PieChart from '@/widget/modules/piechart/PieChart';
|
||||
@@ -25,6 +25,35 @@ import MixedLineStackedBarChart from '@/widget/modules/mixedchart/MixedLineStack
|
||||
import FunnelChart from '@/widget/modules/funnelchart/FunnelChart';
|
||||
import { LoadingContext } from '@/contexts/LoadingContext';
|
||||
|
||||
export const WidgetEmpty = () => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
borderRadius: '6px',
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
sx={{
|
||||
margin: '200px auto',
|
||||
fontSize: '14px',
|
||||
fontWeight: 600,
|
||||
textAlign: 'center',
|
||||
lineHeight: '1.6',
|
||||
color: '#333',
|
||||
}}
|
||||
>
|
||||
위젯 조회에 실패했습니다.
|
||||
<br />
|
||||
다시 시도해 주세요.
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
const WidgetViewer = props => {
|
||||
const { title, widgetType, widgetOption, dataSet } = props;
|
||||
const { showLoading, hideLoading } = useContext(LoadingContext);
|
||||
@@ -488,7 +517,7 @@ const WidgetViewer = props => {
|
||||
padding: '10px 40px 48px 40px',
|
||||
}}
|
||||
>
|
||||
{module}
|
||||
{module ? module : <WidgetEmpty />}
|
||||
{/*<ReactECharts*/}
|
||||
{/* option={componentOption}*/}
|
||||
{/* style={{ height: '100%', maxHeight: '600px', width: '100%' }}*/}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import React, { useContext, useEffect, useState } from 'react';
|
||||
import { get } from '@/helpers/apiHelper';
|
||||
import WidgetViewer from '@/widget/wrapper/WidgetViewer';
|
||||
import DatabaseService from '@/api/databaseService';
|
||||
import { STATUS } from '@/constant';
|
||||
import { LoadingContext } from '@/contexts/LoadingContext';
|
||||
import { useAlert } from 'react-alert';
|
||||
import { SnackbarContext } from '@/contexts/AlertContext';
|
||||
|
||||
const WidgetWrapper = props => {
|
||||
const { widgetOption, dataSetId } = props;
|
||||
const { showLoading, hideLoading } = useContext(LoadingContext);
|
||||
const [dataset, setDataset] = useState(null);
|
||||
const snackbar = useAlert(SnackbarContext);
|
||||
|
||||
useEffect(() => {
|
||||
// console.log('WidgetWrapper widgetOption', widgetOption);
|
||||
@@ -32,6 +34,10 @@ const WidgetWrapper = props => {
|
||||
setDataset(response.data.data.datas);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
snackbar.error('데이터베이스 조회에 실패했습니다.');
|
||||
console.log('error', error);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoading();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user