-
Notifications
You must be signed in to change notification settings - Fork 68
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
Reduce code duplication in bug reporting
, team response
and tester response
views
#1024
Comments
jamesyeap
changed the title
Reduce code duplication in issue components
Reduce code duplication in Oct 22, 2022
title
and description
bug reporting
, team response
and tester response
views
Hi! Could I possibly work on this? |
Hello! Yes please go ahead |
Sorry for all spam above 😓, just realized @RyanCheungJF may still be working on this. |
@cheehongw are you working on this? |
Can we close this issue? I see that there is already a PR that has been merged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As suggested by @gycgabriel, we can reduce the duplication in the code that checks if a user has made any changes to the issue or response while in edit mode.
Context
This feature was introduced in the following PRs:
team response
andtester response
#984This was done to ensure that the when the user leaves edit mode, the cancel edit warning dialog box (that warns the user that some changes made will be discarded) is only shown if he/she has actually made any changes to the issue or response.
Where the code duplication is
The method to detect changes
openCancelDialogIfModified
is currently declared in 4 separate components (shown below):CATcher/src/app/shared/issue/title/title.component.ts
Lines 83 to 92 in 660e017
CATcher/src/app/shared/issue/description/description.component.ts
Lines 121 to 130 in 660e017
CATcher/src/app/shared/view-issue/team-response/team-response.component.ts
Lines 151 to 161 in 660e017
CATcher/src/app/shared/view-issue/tester-response/tester-response.component.ts
Lines 142 to 172 in 660e017
What can be done
There is an opportunity to reduce code duplication, possibly by moving this function into a service.
The text was updated successfully, but these errors were encountered: