This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new b5bdc25fb fix: error encode operate when updating project name (#8073)
b5bdc25fb is described below
commit b5bdc25fbf1b200a9381e493ede1ac247aaa7f94
Author: 青湛 <[email protected]>
AuthorDate: Thu Sep 19 20:52:33 2024 +1200
fix: error encode operate when updating project name (#8073)
---
config-ui/src/api/project/index.ts | 5 +----
config-ui/src/routes/project/additional-settings/index.tsx | 2 +-
config-ui/src/routes/project/layout/index.tsx | 2 +-
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/config-ui/src/api/project/index.ts
b/config-ui/src/api/project/index.ts
index ca008480a..8e79ee5fa 100644
--- a/config-ui/src/api/project/index.ts
+++ b/config-ui/src/api/project/index.ts
@@ -40,8 +40,5 @@ export const remove = (name: string) =>
export const update = (name: string, data: Pick<IProject, 'name' |
'description' | 'metrics'>) =>
request(`/projects/${encodeURIComponent(name)}`, {
method: 'patch',
- data: {
- ...data,
- name: encodeURIComponent(data.name),
- },
+ data,
});
diff --git a/config-ui/src/routes/project/additional-settings/index.tsx
b/config-ui/src/routes/project/additional-settings/index.tsx
index 50cde0b74..f8ebce377 100644
--- a/config-ui/src/routes/project/additional-settings/index.tsx
+++ b/config-ui/src/routes/project/additional-settings/index.tsx
@@ -108,7 +108,7 @@ export const ProjectAdditionalSettings = () => {
if (success) {
setVersion((v) => v + 1);
- navigate(`/projects/${encodeURIComponent(pname)}`, {
+ navigate(`/projects/${encodeURIComponent(name)}`, {
state: {
tabId: 'settings',
},
diff --git a/config-ui/src/routes/project/layout/index.tsx
b/config-ui/src/routes/project/layout/index.tsx
index ae0647c22..d96747a29 100644
--- a/config-ui/src/routes/project/layout/index.tsx
+++ b/config-ui/src/routes/project/layout/index.tsx
@@ -124,7 +124,7 @@ export const ProjectLayout = () => {
<p>
{breadcrumbs(paths).map((b, i) => (
<span key={b.path}>
- {i !== paths.length - 2 ? <Link to={b.path}>{b.name}</Link> :
<span>{b.name}</span>}
+ {i !== paths.length - 2 ? <Link to={b.path}>{b.name}</Link> :
<span>{decodeURIComponent(b.name)}</span>}
<span> / </span>
</span>
))}