-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a report card with already existing name created show proper error message #1297
Comments
Hey @mahalakshme. Could you please assign me the issue. |
@Bhushan-Thombre sure you can work on it |
@mahalakshme Kindly review the below PR. |
…lated to server error handling. text color fix in snack bar.
…l. set a voided name for card being deleted. handle unique constraint error. added unique constraint for name.
@petmongrels Created this draft sql script for fixing the duplicate report_cards |
|
@himeshr @petmongrels In the SQL migration as well as in UI check, should be able to create a new report card, if the report card with the same name was voided before. Will make the AC more explicit next time. But have mentioned in the issue. |
…ded entities only, while asserting unique name for reportCard
Based on analysis so far, does not seem possible to implement DB level constraint which adheres to all the considerations below:
Based on following stackoverflow comments: Putting on hold for now.. for working on higher priority task. Might be better to just add "(Voided |
…uffix voided~id
We already rename voided report cards to include suffix voided~id. And with the existing unique constraint and case-insensitive check in sever, we should not be able to create cards with same name for an org, through the app. |
…edFalse to CardRepository
SQL command to find already existing report-cards with case-insensitive match within same org.select o.name, lower(rc.name), count(*)
from report_card rc
join organisation o on rc.organisation_id = o.id
where not rc.is_voided
group by 1,2
having count(*) > 1; In prod all report-cards are in decomissioned UAT orgs. |
…edFalse invocation capable of returning all matches
Need to fix the comments and merge the PR. The contributor is missing.
Issue:
Create a report card with same name as non-voided existing report card. The below issue happens.
AC:
Show error message stating 'Report card with same name already exists' in the place where 'Name cannot be empty' is shown in the image below (or) when handling all these issues at server side is easier, then we can just show a common toast error message at the bottom if that will simplify the work across if in any new entities we face this issue.
The text was updated successfully, but these errors were encountered: