Currently, copying a portfolio where the name is under the max character length, but the addition of "Copy of" pushes it over the max character length, we are truncating by adding "..." to the end. However, this causes an issue when trying to copy the portfolio again, because the comparison regex is trying to match by starting with "Copy of", but ending with whatever the original portfolio's name was, and not "...", so it doesn't think there's a match, and it attempts to create a portfolio with the same name as "Copy of".
It should instead correctly recognize that there is already an existing copy, and end up being "Copy (1) of" with an even slightly shorter name since we're adding 4 more characters that will push off part of the original name to be truncated. Likewise, if "Copy of" and "Copy (1) of" the existing truncated name exists, it should move to "Copy (2) of".
https://projects.engineering.redhat.com/browse/SSP-1560
@clacroix12 Tagging you since you worked on the first truncate story. 👍
Currently, copying a portfolio where the name is under the max character length, but the addition of "Copy of" pushes it over the max character length, we are truncating by adding "..." to the end. However, this causes an issue when trying to copy the portfolio again, because the comparison regex is trying to match by starting with "Copy of", but ending with whatever the original portfolio's name was, and not "...", so it doesn't think there's a match, and it attempts to create a portfolio with the same name as "Copy of".
It should instead correctly recognize that there is already an existing copy, and end up being "Copy (1) of" with an even slightly shorter name since we're adding 4 more characters that will push off part of the original name to be truncated. Likewise, if "Copy of" and "Copy (1) of" the existing truncated name exists, it should move to "Copy (2) of".
https://projects.engineering.redhat.com/browse/SSP-1560
@clacroix12 Tagging you since you worked on the first truncate story. 👍