You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by mi...@apache.org on 2023/05/08 04:05:58 UTC

[incubator-hugegraph-toolchain] branch master updated: set default data when create graph (#447)

This is an automated email from the ASF dual-hosted git repository.

ming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-toolchain.git


The following commit(s) were added to refs/heads/master by this push:
     new 80b59838 set default data  when create graph (#447)
80b59838 is described below

commit 80b59838e115aabe7a55f6f936d54e0b30a712c2
Author: wanganjuan <z7...@Outlook.com>
AuthorDate: Mon May 8 12:05:53 2023 +0800

    set default data  when create graph (#447)
    
    Co-authored-by: imbajin <ji...@apache.org>
---
 .../src/components/graph-management/GraphManagementEmptyList.tsx  | 3 +++
 .../src/components/graph-management/GraphManagementHeader.tsx     | 3 +++
 .../src/stores/GraphManagementStore/graphManagementStore.ts       | 8 ++++++++
 3 files changed, 14 insertions(+)

diff --git a/hugegraph-hubble/hubble-fe/src/components/graph-management/GraphManagementEmptyList.tsx b/hugegraph-hubble/hubble-fe/src/components/graph-management/GraphManagementEmptyList.tsx
index 06ed4bf4..fce9a4c4 100644
--- a/hugegraph-hubble/hubble-fe/src/components/graph-management/GraphManagementEmptyList.tsx
+++ b/hugegraph-hubble/hubble-fe/src/components/graph-management/GraphManagementEmptyList.tsx
@@ -30,6 +30,9 @@ const GraphManagementEmptyList: React.FC = observer(() => {
 
   const handleLayoutSwitch = useCallback(
     (flag: boolean) => () => {
+      if (flag) {
+        graphManagementStore.fillInGraphDataDefaultConfig();
+      }
       graphManagementStore.switchCreateNewGraph(flag);
     },
     [graphManagementStore]
diff --git a/hugegraph-hubble/hubble-fe/src/components/graph-management/GraphManagementHeader.tsx b/hugegraph-hubble/hubble-fe/src/components/graph-management/GraphManagementHeader.tsx
index 8f9a01ad..3ba7646c 100644
--- a/hugegraph-hubble/hubble-fe/src/components/graph-management/GraphManagementHeader.tsx
+++ b/hugegraph-hubble/hubble-fe/src/components/graph-management/GraphManagementHeader.tsx
@@ -31,6 +31,9 @@ const GraphManagementHeader: React.FC = observer(() => {
   const { t } = useTranslation();
   const handleLayoutSwitch = useCallback(
     (flag: boolean) => () => {
+      if (flag) {
+        graphManagementStore.fillInGraphDataDefaultConfig();
+      }
       graphManagementStore.switchCreateNewGraph(flag);
     },
     [graphManagementStore]
diff --git a/hugegraph-hubble/hubble-fe/src/stores/GraphManagementStore/graphManagementStore.ts b/hugegraph-hubble/hubble-fe/src/stores/GraphManagementStore/graphManagementStore.ts
index a84c0edb..d22e5e78 100644
--- a/hugegraph-hubble/hubble-fe/src/stores/GraphManagementStore/graphManagementStore.ts
+++ b/hugegraph-hubble/hubble-fe/src/stores/GraphManagementStore/graphManagementStore.ts
@@ -220,6 +220,14 @@ export class GraphManagementStore {
     this.editGraphData.password = this.graphData[index].password;
   }
 
+  @action
+  fillInGraphDataDefaultConfig() {
+    this.newGraphData.name = 'test';
+    this.newGraphData.graph = 'hugegraph';
+    this.newGraphData.host = '0.0.0.0';
+    this.newGraphData.port = '8080';
+  }
+
   @action
   resetGraphDataConfig(type: 'new' | 'edit') {
     if (type === 'new') {