Skip to content

Commit

Permalink
Fix [Project Settings, Projects] The second 'confirm message' is miss…
Browse files Browse the repository at this point in the history
…ing when deleting a non-empty project (#3005)
  • Loading branch information
ilan7empest authored Jan 13, 2025
1 parent 3b5f4a5 commit 19c61a8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
13 changes: 5 additions & 8 deletions src/api/projects-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ const projectsApi = {
}),
createProject: postData => mainHttpClient.post('/projects', postData),
deleteProject: (project, deleteNonEmpty) =>
mainHttpClientV2.delete(
`/projects/${project}`,
deleteNonEmpty && {
headers: {
'x-mlrun-deletion-strategy': 'cascade'
}
mainHttpClientV2.delete(`/projects/${project}`, {
headers: {
'x-mlrun-deletion-strategy': deleteNonEmpty ? 'cascade' : 'restricted'
}
),
}),
deleteSecret: (project, key) =>
mainHttpClient.delete(`/projects/${project}/secrets?provider=kubernetes&secret=${key}`),
editProject: (project, data) => mainHttpClient.put(`/projects/${project}`, data),
Expand Down Expand Up @@ -84,7 +81,7 @@ const projectsApi = {
signal
}),
getProjectSummary: (project, signal) => {
return mainHttpClient.get(`/project-summaries/${project}`, {signal})
return mainHttpClient.get(`/project-summaries/${project}`, { signal })
},
getProjectWorkflows: project => {
return mainHttpClient.get(`/projects/${project}/pipelines`)
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectSettings/ProjectSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ const ProjectSettings = () => {
/>
)}

{ projectStore.projectsToDelete.includes(params.projectName) && <Loader />}
{projectStore.projectsToDelete.includes(params.projectName) && <Loader />}

<div className="settings">
<div className="settings__header">
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectsPage/ProjectsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const ProjectsView = ({
}}
closePopUp={confirmData.rejectHandler}
confirmButton={{
handler: () => confirmData.confirmHandler(confirmData.item),
handler: confirmData.confirmHandler,
label: confirmData.btnConfirmLabel,
variant: confirmData.btnConfirmType
}}
Expand Down
5 changes: 2 additions & 3 deletions src/components/ProjectsPage/projects.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const handleDeleteProjectError = (
rejectHandler: () => {
setConfirmData(null)
},
confirmHandler: project => {
confirmHandler: () => {
handleDeleteProject(
project,
true,
Expand Down Expand Up @@ -336,8 +336,7 @@ export const onDeleteProject = (project, setConfirmData, ...args) => {
rejectHandler: () => {
setConfirmData(null)
},
confirmHandler: deleteNonEmpty =>
handleDeleteProject(project, deleteNonEmpty, setConfirmData, ...args)
confirmHandler: () => handleDeleteProject(project, false, setConfirmData, ...args)
})
}

Expand Down

0 comments on commit 19c61a8

Please sign in to comment.