From 0cffa62f97374e67d2edcd13b27e9d258d44869f Mon Sep 17 00:00:00 2001 From: hetao92 <18328704+hetao92@users.noreply.github.com> Date: Thu, 6 Apr 2023 02:56:30 +0000 Subject: [PATCH 1/5] mod: fix style --- app/components/FileConfigSetting/index.module.less | 1 + .../DatasourceConfig/PlatformConfig/index.tsx | 2 +- app/pages/Import/DatasourceList/LocalFileList/index.tsx | 4 +++- app/pages/Import/TaskCreate/index.tsx | 7 +++++-- deployment/docker/docker-compose.yml | 2 +- deployment/helm/README.md | 2 +- deployment/helm/values.yaml | 2 +- package.json | 2 +- server/api/studio/internal/service/import.go | 1 - 9 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/components/FileConfigSetting/index.module.less b/app/components/FileConfigSetting/index.module.less index 470fabf0..f22ec9c4 100644 --- a/app/components/FileConfigSetting/index.module.less +++ b/app/components/FileConfigSetting/index.module.less @@ -96,6 +96,7 @@ } .ant-modal-confirm-btns { + width: 100%; margin-top: 0; padding-bottom: 20px; display: flex; diff --git a/app/pages/Import/DatasourceList/DatasourceConfig/PlatformConfig/index.tsx b/app/pages/Import/DatasourceList/DatasourceConfig/PlatformConfig/index.tsx index d9aceb4a..97484876 100644 --- a/app/pages/Import/DatasourceList/DatasourceConfig/PlatformConfig/index.tsx +++ b/app/pages/Import/DatasourceList/DatasourceConfig/PlatformConfig/index.tsx @@ -20,7 +20,7 @@ interface IProps { } const fomrItemLayout = { - labelCol: { span: 7, offset: 2 }, + labelCol: { span: 8, offset: 1 }, wrapperCol: { span: 10 }, }; diff --git a/app/pages/Import/DatasourceList/LocalFileList/index.tsx b/app/pages/Import/DatasourceList/LocalFileList/index.tsx index cc5769a3..fd8bae86 100644 --- a/app/pages/Import/DatasourceList/LocalFileList/index.tsx +++ b/app/pages/Import/DatasourceList/LocalFileList/index.tsx @@ -43,7 +43,9 @@ const FileList = () => { title: intl.get('common.operation'), key: 'operation', render: (_, file) => { - if(!file.sample) { + // sample could be '' if file is empty + // eslint-disable-next-line eqeqeq + if(file.sample == undefined) { return null; } return ( diff --git a/app/pages/Import/TaskCreate/index.tsx b/app/pages/Import/TaskCreate/index.tsx index 89778169..58db4667 100644 --- a/app/pages/Import/TaskCreate/index.tsx +++ b/app/pages/Import/TaskCreate/index.tsx @@ -39,7 +39,7 @@ const AddMappingBtn = (props: { type: ISchemaType }) => { }; const TaskCreate = (props: IProps) => { - const { dataImport, schema, files, global } = useStore(); + const { dataImport, schema, files, global, datasource } = useStore(); const { intl, currentLocale } = useI18n(); const { basicConfig, tagConfig, edgeConfig, updateBasicConfig, importTask } = dataImport; const { spaces, getSpaces, updateSpaceInfo, currentSpace } = schema; @@ -70,7 +70,10 @@ const TaskCreate = (props: IProps) => { updateSpaceInfo(currentSpace); } trackPageView('/import/create'); - return () => clearConfig('all'); + return () => { + clearConfig('all'); + datasource.update({ cachedStore: null }); + }; }, []); const checkConfig = () => { diff --git a/deployment/docker/docker-compose.yml b/deployment/docker/docker-compose.yml index 4c7173ac..05b653fa 100644 --- a/deployment/docker/docker-compose.yml +++ b/deployment/docker/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.4' services: web: - image: vesoft/nebula-graph-studio:v3.7.0 + image: vesoft/nebula-graph-studio:v3.8.0-beta environment: USER: root ports: diff --git a/deployment/helm/README.md b/deployment/helm/README.md index a0fd16f0..8aad71ef 100644 --- a/deployment/helm/README.md +++ b/deployment/helm/README.md @@ -48,7 +48,7 @@ $ helm uninstall my-studio |-----------|-------------|---------| | replicaCount | Replicas for Deployment | 0 | | image.nebulaStudio.name | The image name of nebula-graph-studio | vesoft/nebula-graph-studio | -| image.nebulaStudio.version | The image version nebula-graph-studio | v3.7.0 | +| image.nebulaStudio.version | The image version nebula-graph-studio | v3.8.0-beta | | service.type | The service type, should be one of ['NodePort', 'ClusterIP', 'LoadBalancer'] | ClusterIP | | service.port | The expose port for nebula-studio server | 7001 | | service.nodePort | The proxy port for accessing nebula-studio outside k8s cluster | 32701 | diff --git a/deployment/helm/values.yaml b/deployment/helm/values.yaml index a6a2d9f6..d90c5520 100644 --- a/deployment/helm/values.yaml +++ b/deployment/helm/values.yaml @@ -4,7 +4,7 @@ image: pullPolicy: IfNotPresent nebulaStudio: name: vesoft/nebula-graph-studio - version: v3.7.0 + version: v3.8.0-beta imagePullSecrets: [] diff --git a/package.json b/package.json index 35e0ac38..4c79cd5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nebula-graph-studio", - "version": "3.7.0", + "version": "3.8.0-beta", "description": "nebula-graph-studio", "private": true, "scripts": { diff --git a/server/api/studio/internal/service/import.go b/server/api/studio/internal/service/import.go index 4a526054..9bbcc365 100644 --- a/server/api/studio/internal/service/import.go +++ b/server/api/studio/internal/service/import.go @@ -68,7 +68,6 @@ func NewImportService(ctx context.Context, svcCtx *svc.ServiceContext) ImportSer } func (i *importService) updateDatasourceConfig(conf *types.CreateImportTaskRequest) (*types.ImportTaskConfig, error) { - // config := conf.Config var config types.ImportTaskConfig if err := json.Unmarshal([]byte(conf.Config), &config); err != nil { return nil, ecode.WithErrorMessage(ecode.ErrBadRequest, err) From 9eacac5f4e44e6d53bef7d760ca93a5fd83964fd Mon Sep 17 00:00:00 2001 From: hetao92 <18328704+hetao92@users.noreply.github.com> Date: Thu, 6 Apr 2023 08:47:11 +0000 Subject: [PATCH 2/5] mod: code review --- app/pages/Import/TaskList/TemplateModal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pages/Import/TaskList/TemplateModal/index.tsx b/app/pages/Import/TaskList/TemplateModal/index.tsx index e760844d..59d7ef27 100644 --- a/app/pages/Import/TaskList/TemplateModal/index.tsx +++ b/app/pages/Import/TaskList/TemplateModal/index.tsx @@ -99,7 +99,7 @@ const TemplateModal = (props: IProps) => { }, [currentLocale, username]); const validatePassword = useCallback((client) => validateEmpty('password', client.password), []); const validateS3 = useCallback((s3) => validateEmpty('s3AccessKey', s3.accessKey) || validateEmpty('s3SecretKey', s3.secretKey), []); - const validateSftp = useCallback((sftp) => validateEmpty('sftpUsername', sftp.username) || validateEmpty('sftpPassword', sftp.password), []); + const validateSftp = useCallback((sftp) => validateEmpty('sftpUsername', sftp.user) || validateEmpty('sftpPassword', sftp.password), []); const validateOSS = useCallback((oss) => validateEmpty('ossAccessKey', oss.accessKey) || validateEmpty('ossSecretKey', oss.secretKey), []); const validateClient = useCallback((content) => { const client = content.client || {}; From 44167c37f0ac9adbd59a3869f144553d5aa4f1e0 Mon Sep 17 00:00:00 2001 From: hetao92 <18328704+hetao92@users.noreply.github.com> Date: Fri, 7 Apr 2023 07:38:08 +0000 Subject: [PATCH 3/5] mod: code review --- deployment/docker/docker-compose.yml | 2 +- deployment/helm/README.md | 2 +- deployment/helm/values.yaml | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deployment/docker/docker-compose.yml b/deployment/docker/docker-compose.yml index 05b653fa..4c7173ac 100644 --- a/deployment/docker/docker-compose.yml +++ b/deployment/docker/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.4' services: web: - image: vesoft/nebula-graph-studio:v3.8.0-beta + image: vesoft/nebula-graph-studio:v3.7.0 environment: USER: root ports: diff --git a/deployment/helm/README.md b/deployment/helm/README.md index 8aad71ef..a0fd16f0 100644 --- a/deployment/helm/README.md +++ b/deployment/helm/README.md @@ -48,7 +48,7 @@ $ helm uninstall my-studio |-----------|-------------|---------| | replicaCount | Replicas for Deployment | 0 | | image.nebulaStudio.name | The image name of nebula-graph-studio | vesoft/nebula-graph-studio | -| image.nebulaStudio.version | The image version nebula-graph-studio | v3.8.0-beta | +| image.nebulaStudio.version | The image version nebula-graph-studio | v3.7.0 | | service.type | The service type, should be one of ['NodePort', 'ClusterIP', 'LoadBalancer'] | ClusterIP | | service.port | The expose port for nebula-studio server | 7001 | | service.nodePort | The proxy port for accessing nebula-studio outside k8s cluster | 32701 | diff --git a/deployment/helm/values.yaml b/deployment/helm/values.yaml index d90c5520..a6a2d9f6 100644 --- a/deployment/helm/values.yaml +++ b/deployment/helm/values.yaml @@ -4,7 +4,7 @@ image: pullPolicy: IfNotPresent nebulaStudio: name: vesoft/nebula-graph-studio - version: v3.8.0-beta + version: v3.7.0 imagePullSecrets: [] diff --git a/package.json b/package.json index 4c79cd5a..35e0ac38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nebula-graph-studio", - "version": "3.8.0-beta", + "version": "3.7.0", "description": "nebula-graph-studio", "private": true, "scripts": { From 06137ebb512e0407845177038f9be91af4ab0382 Mon Sep 17 00:00:00 2001 From: hetao92 <18328704+hetao92@users.noreply.github.com> Date: Mon, 10 Apr 2023 08:48:06 +0000 Subject: [PATCH 4/5] mod: code review --- app/pages/Import/TaskCreate/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pages/Import/TaskCreate/index.tsx b/app/pages/Import/TaskCreate/index.tsx index 58db4667..215fc89e 100644 --- a/app/pages/Import/TaskCreate/index.tsx +++ b/app/pages/Import/TaskCreate/index.tsx @@ -150,7 +150,7 @@ const TaskCreate = (props: IProps) => { edgeConfig: [] } as any; if(type === 'all') { - params.basicConfig = { taskName: '', address: address.map(i => i.value) }; + params.basicConfig = { taskName: '', address: [] }; } dataImport.update(params); }, []); From c168e63e46a1f2a2917e9d30b23462e79bc78623 Mon Sep 17 00:00:00 2001 From: hetao92 <18328704+hetao92@users.noreply.github.com> Date: Mon, 10 Apr 2023 08:50:24 +0000 Subject: [PATCH 5/5] mod: code review --- app/pages/Import/TaskCreate/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/pages/Import/TaskCreate/index.tsx b/app/pages/Import/TaskCreate/index.tsx index 215fc89e..c26c7028 100644 --- a/app/pages/Import/TaskCreate/index.tsx +++ b/app/pages/Import/TaskCreate/index.tsx @@ -12,6 +12,7 @@ import { ISchemaEnum, ISchemaType } from '@app/interfaces/schema'; import Icon from '@app/components/Icon'; import Instruction from '@app/components/Instruction'; import { isEmpty } from '@app/utils/function'; +import { ImportStore } from '@app/stores/import'; import styles from './index.module.less'; import ConfigConfirmModal from './ConfigConfirmModal'; import SchemaConfig from './SchemaConfig'; @@ -148,7 +149,7 @@ const TaskCreate = (props: IProps) => { const params = { tagConfig: [], edgeConfig: [] - } as any; + } as Partial; if(type === 'all') { params.basicConfig = { taskName: '', address: [] }; }