Skip to content
Permalink
Browse files
[HugeGraph-Hubble-fe] Pop up error message when the creation of verte…
…x/edge map failed (#292)
  • Loading branch information
OshotOkill committed Jan 15, 2021
1 parent 2ac4b09 commit d010f54e3a7457e62a659a76ec0daf7e0dc8f49c
Showing 2 changed files with 23 additions and 7 deletions.
@@ -3,7 +3,7 @@ import { observer } from 'mobx-react';
import { isUndefined, isEmpty, size, cloneDeep } from 'lodash-es';
import { useTranslation } from 'react-i18next';
import classnames from 'classnames';
import { Input, Select, Checkbox } from '@baidu/one-ui';
import { Input, Select, Checkbox, Message } from '@baidu/one-ui';

import { Tooltip } from '../../../../common';
import { DataImportRootStoreContext } from '../../../../../stores';
@@ -1639,20 +1639,28 @@ const EdgeMap: React.FC<EdgeMapProps> = observer(
!dataMapStore.allowAddPropertyMapping('edge') ||
!dataMapStore.isValidateSave
}
onCreate={() => {
onCreate={async () => {
dataMapStore.switchAddNewTypeConfig(false);
dataMapStore.switchEditTypeConfig(false);

isEdit
? dataMapStore.updateEdgeMap(
? await dataMapStore.updateEdgeMap(
'upgrade',
dataMapStore.selectedFileId
)
: dataMapStore.updateEdgeMap(
: await dataMapStore.updateEdgeMap(
'add',
dataMapStore.selectedFileId
);

if (dataMapStore.requestStatus.updateEdgeMap === 'failed') {
Message.error({
content: dataMapStore.errorInfo.updateEdgeMap.message,
size: 'medium',
showCloseIcon: false
});
}

onCancelCreateEdge();
dataMapStore.resetNewMap('edge');
}}
@@ -9,7 +9,7 @@ import { observer } from 'mobx-react';
import { isUndefined, isEmpty, size, cloneDeep } from 'lodash-es';
import { useTranslation } from 'react-i18next';
import classnames from 'classnames';
import { Input, Select, Checkbox } from '@baidu/one-ui';
import { Input, Select, Checkbox, Message } from '@baidu/one-ui';

import { Tooltip } from '../../../../common';
import TypeConfigManipulations from './TypeConfigManipulations';
@@ -1555,16 +1555,24 @@ const VertexMap: React.FC<VertexMapProps> = observer(
dataMapStore.fetchDataMaps();
} else {
isEdit
? dataMapStore.updateVertexMap(
? await dataMapStore.updateVertexMap(
'upgrade',
dataMapStore.selectedFileId
)
: dataMapStore.updateVertexMap(
: await dataMapStore.updateVertexMap(
'add',
dataMapStore.selectedFileId
);
}

if (dataMapStore.requestStatus.updateVertexMap === 'failed') {
Message.error({
content: dataMapStore.errorInfo.updateVertexMap.message,
size: 'medium',
showCloseIcon: false
});
}

onCancelCreateVertex();
dataMapStore.resetNewMap('vertex');
}}

0 comments on commit d010f54

Please sign in to comment.