You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2024/02/08 09:35:39 UTC

(incubator-devlake) 01/01: feat: add default name for scope config

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

mintsweet pushed a commit to branch feat-scope-config-default-name
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 69f4f554fff90c730e26b1bcf5794e68ffd6ac64
Author: mintsweet <0x...@gmail.com>
AuthorDate: Thu Feb 8 22:35:26 2024 +1300

    feat: add default name for scope config
---
 config-ui/src/plugins/components/scope-config-form/index.tsx   | 4 +++-
 config-ui/src/plugins/components/scope-config-select/index.tsx | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/config-ui/src/plugins/components/scope-config-form/index.tsx b/config-ui/src/plugins/components/scope-config-form/index.tsx
index f7f359eb4..3e897143e 100644
--- a/config-ui/src/plugins/components/scope-config-form/index.tsx
+++ b/config-ui/src/plugins/components/scope-config-form/index.tsx
@@ -39,6 +39,7 @@ import { TIPS_MAP } from './misc';
 interface Props {
   plugin: string;
   connectionId: ID;
+  defaultName?: string;
   showWarning?: boolean;
   scopeId?: ID;
   scopeConfigId?: ID;
@@ -49,6 +50,7 @@ interface Props {
 export const ScopeConfigForm = ({
   plugin,
   connectionId,
+  defaultName,
   showWarning = false,
   scopeId,
   scopeConfigId,
@@ -56,7 +58,7 @@ export const ScopeConfigForm = ({
   onSubmit,
 }: Props) => {
   const [step, setStep] = useState(1);
-  const [name, setName] = useState('');
+  const [name, setName] = useState(defaultName);
   const [entities, setEntities] = useState<string[]>([]);
   const [transformation, setTransformation] = useState<any>({});
   const [hasError, setHasError] = useState(false);
diff --git a/config-ui/src/plugins/components/scope-config-select/index.tsx b/config-ui/src/plugins/components/scope-config-select/index.tsx
index be1d5cce2..c16538a0e 100644
--- a/config-ui/src/plugins/components/scope-config-select/index.tsx
+++ b/config-ui/src/plugins/components/scope-config-select/index.tsx
@@ -120,6 +120,7 @@ export const ScopeConfigSelect = ({ plugin, connectionId, scopeConfigId, onCance
         <ScopeConfigForm
           plugin={plugin}
           connectionId={connectionId}
+          defaultName={`shared-config-<${dataSource.length}>`}
           showWarning={!!updatedId}
           scopeConfigId={updatedId}
           onCancel={handleHideDialog}