@@ -1062,6 +1063,8 @@ const CreateEdge: React.FC = observer(() => {
edgeTypeStore.validateNewEdgeType(
'propertyIndexes'
);
+
+ setDeletePopIndex(null);
}}
>
确认
diff --git a/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CreateVertex.tsx b/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CreateVertex.tsx
index 60cc04a0..28f36165 100644
--- a/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CreateVertex.tsx
+++ b/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CreateVertex.tsx
@@ -34,6 +34,7 @@ import type { VertexTypeValidatePropertyIndexes } from '../../../../stores/types
import BlueArrowIcon from '../../../../assets/imgs/ic_arrow_blue.svg';
import HintIcon from '../../../../assets/imgs/ic_question_mark.svg';
import closeIcon from '../../../../assets/imgs/ic_close_16.svg';
+import { clearObserving } from 'mobx/lib/internal';
const CreateVertex: React.FC = observer(() => {
const dataAnalyzeStore = useContext(DataAnalyzeStore);
@@ -967,7 +968,8 @@ const CreateVertex: React.FC = observer(() => {
}
}}
tooltipWrapperProps={{
- className: 'metadata-properties-tooltips'
+ className: 'metadata-properties-tooltips',
+ style: { zIndex: 1041 }
}}
tooltipWrapper={
diff --git a/hubble-fe/src/components/graph-management/metadata-configs/graph-view/GraphView.tsx b/hubble-fe/src/components/graph-management/metadata-configs/graph-view/GraphView.tsx
index 0c1e9fe8..a035e436 100644
--- a/hubble-fe/src/components/graph-management/metadata-configs/graph-view/GraphView.tsx
+++ b/hubble-fe/src/components/graph-management/metadata-configs/graph-view/GraphView.tsx
@@ -284,6 +284,11 @@ const GraphDataView: React.FC = observer(() => {
graphViewStore.setCurrentDrawer('check-vertex');
graphViewStore.switchNodeOrEdgeClicked(true);
+
+ // check if vertex type being used
+ vertexTypeStore.checkIfUsing([
+ vertexTypeStore.selectedVertexType!.name
+ ]);
}
return;
diff --git a/hubble-fe/src/components/graph-management/metadata-configs/property/MetadataProperties.tsx b/hubble-fe/src/components/graph-management/metadata-configs/property/MetadataProperties.tsx
index c7a4438d..a7e4e57a 100644
--- a/hubble-fe/src/components/graph-management/metadata-configs/property/MetadataProperties.tsx
+++ b/hubble-fe/src/components/graph-management/metadata-configs/property/MetadataProperties.tsx
@@ -6,7 +6,7 @@ import React, {
useCallback
} from 'react';
import { observer } from 'mobx-react';
-import { intersection, size, without } from 'lodash-es';
+import { intersection, size, without, values } from 'lodash-es';
import { motion } from 'framer-motion';
import {
Input,
@@ -166,6 +166,20 @@ const MetadataProperties: React.FC = observer(() => {
};
const batchDeleteProperties = async () => {
+ if (
+ values(currentSelectedRowKeys).every(
+ (key) => metadataPropertyStore.metadataPropertyUsingStatus?.[key]
+ )
+ ) {
+ Message.error({
+ content: '无可删除属性',
+ size: 'medium',
+ showCloseIcon: false
+ });
+
+ return;
+ }
+
switchShowModal(false);
// need to set a copy in store since local row key state would be cleared
metadataPropertyStore.mutateSelectedMetadataProperyNames(
diff --git a/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/NewVertexType.tsx b/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/NewVertexType.tsx
index 41545c69..8828e9c6 100644
--- a/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/NewVertexType.tsx
+++ b/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/NewVertexType.tsx
@@ -267,6 +267,7 @@ const NewVertexType: React.FC = observer(() => {
const currentProperties = cloneDeep(
vertexTypeStore.newVertexType.properties
);
+
return (
{
{
- currentProperties[
- index
- ].nullable = !currentProperties[index].nullable;
+ onChange={(checked: boolean) => {
+ currentProperties[index].nullable = checked;
vertexTypeStore.mutateNewProperty({
...vertexTypeStore.newVertexType,
properties: currentProperties
});
+
+ // remove primary keys since it could be empty value
+ if (checked) {
+ vertexTypeStore.mutateNewProperty({
+ ...vertexTypeStore.newVertexType,
+ primary_keys: vertexTypeStore.newVertexType.primary_keys.filter(
+ (key) => key !== property.name
+ )
+ });
+ }
}}
size="large"
/>
diff --git a/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/VertexTypeList.tsx b/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/VertexTypeList.tsx
index 4d4e99fa..15baa76b 100644
--- a/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/VertexTypeList.tsx
+++ b/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/VertexTypeList.tsx
@@ -12,7 +12,8 @@ import {
size,
without,
isEmpty,
- isUndefined
+ isUndefined,
+ values
} from 'lodash-es';
import { useLocation } from 'wouter';
import classnames from 'classnames';
@@ -160,12 +161,25 @@ const VertexTypeList: React.FC = observer(() => {
};
const batchDeleteProperties = async () => {
+ if (
+ values(currentSelectedRowKeys).every(
+ (key) => vertexTypeStore.vertexTypeUsingStatus?.[key]
+ )
+ ) {
+ Message.error({
+ content: '无可删除顶点类型',
+ size: 'medium',
+ showCloseIcon: false
+ });
+
+ return;
+ }
+
switchShowModal(false);
// need to set a copy in store since local row key state would be cleared
vertexTypeStore.mutateSelectedVertexTypeNames(currentSelectedRowKeys);
// mutateSelectedRowKeys([]);
await vertexTypeStore.deleteVertexType(currentSelectedRowKeys);
- // vertexTypeStore.mutateSelectedVertexTypeNames([]);
if (vertexTypeStore.requestStatus.deleteVertexType === 'success') {
Message.success({
@@ -486,8 +500,14 @@ const VertexTypeList: React.FC = observer(() => {
}}
/>
+
+ 使用中顶点类型不可删除,确认删除以下未使用顶点类型?
+
- 使用中顶点不可删除,确认删除以下未使用顶点?
+ 删除元数据耗时较久,详情可在任务管理中查看。
= observe
) : (
<>
- 确认删除此顶点?
+ 确认删除此顶点类型?
- 确认删除此属性?删除后无法恢复,请谨慎操作
+ 确认删除此顶点类型?删除后无法恢复,请谨慎操作
删除元数据耗时较久,详情可在任务管理中查看