This is an automated email from the ASF dual-hosted git repository. mintsweet pushed a commit to branch fix-project-name in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit c6083093f4f8e625f5d3710bd246fda0363fa917 Author: mintsweet <[email protected]> AuthorDate: Thu Sep 19 20:46:45 2024 +1200 fix: error encode operate when updating project name --- 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> ))}
