Skip to content

Conversation

@Suhas2109
Copy link
Contributor

@Suhas2109 Suhas2109 commented Nov 3, 2025

image

This PR improves project creation error handling.
When a duplicate project is created, the UI now displays the backend conflict message.

Example:
sw360 project with name 'DuplicateProject' already exists

@amritkv
Copy link
Member

amritkv commented Nov 3, 2025

image This PR improves project creation error handling. When a duplicate project is created, the UI now displays the backend conflict message along with the last modified date instead of a generic error.

Example:

sw360 project with name 'DuplicateProject' already exists (last modified on 2025-11-03)

Hey @Suhas2109 !
I think the date you are trying to display on the error banner as Last Modified, the timestamp in the response body captures the current date-time and not the actual date-time of the previous project created.

@Suhas2109 Suhas2109 force-pushed the fix/duplicateProjectErrorMessage branch from 1a8d361 to ab655b9 Compare November 4, 2025 04:45
@Suhas2109
Copy link
Contributor Author

Suhas2109 commented Nov 4, 2025

Hi @amritkv
I’ve removed the modified date from the error banner and now display only the backend message.
On 409: banner shows the API message.

@Suhas2109 Suhas2109 force-pushed the fix/duplicateProjectErrorMessage branch from 40ae777 to 6611ee2 Compare November 4, 2025 06:49
@Suhas2109
Copy link
Contributor Author

Hi @amritkv
I’ve updated the changes as suggested.

MessageService.success(t('Your project is created'))
router.push(`/projects/detail/${data._links.self.href.split('/').at(-1)}`)
return
} if (response.status === StatusCodes.CONFLICT) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Suhas2109 !
Logically it would be great to use if - else if instead of if - if as the branches of these conditions are mutually exclusive

@Suhas2109 Suhas2109 force-pushed the fix/duplicateProjectErrorMessage branch from a797aa5 to f181745 Compare November 6, 2025 13:26
@Suhas2109
Copy link
Contributor Author

Hey @amritkv
I’ve updated the conditional to use if - else if.

@Suhas2109 Suhas2109 force-pushed the fix/duplicateProjectErrorMessage branch from f181745 to 61cf4e3 Compare November 6, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do not merge don't merge needs general test needs general test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants