Skip to content

Fix bug related to assignees dropdown showing old values#1349

Merged
Arif-Khalid merged 2 commits intoCATcher-org:masterfrom
yucongkoo:1348-issue-with-reassigning-assignees-after-unchecking-issue-as-duplicate
Mar 24, 2025
Merged

Fix bug related to assignees dropdown showing old values#1349
Arif-Khalid merged 2 commits intoCATcher-org:masterfrom
yucongkoo:1348-issue-with-reassigning-assignees-after-unchecking-issue-as-duplicate

Conversation

@yucongkoo
Copy link
Copy Markdown
Contributor

Summary:

Fixes #1348

Changes Made:

  • Fixed the bug as mentioned in the issue by updating the value of assignees accordingly when the issue changed

Proposed Commit Message:

Fix bug related to assignees dropdown showing old values

@yucongkoo yucongkoo self-assigned this Mar 24, 2025
@yucongkoo
Copy link
Copy Markdown
Contributor Author

The key problem here is that the value shown in the dropdown of assignees is the variable this.assignees, and this value is not updated when the this.issue is updated (which is the case when we mark and unmark an issue as duplicate).
Screenshot 2025-03-24 at 2 13 51 PM

@yucongkoo
Copy link
Copy Markdown
Contributor Author

@damithc
Copy link
Copy Markdown
Contributor

damithc commented Mar 24, 2025

@yucongkoo What's the current behaviour? Is it as follows?

Suppose issue A is assigned to Adam, and issue B is assigned to Betsy.

Issue A (Adam)
Issue B (Betsy)

Issue B is marked as a duplicate of A -> Issue B's previous assignees (i.e., Betsy) are removed. It inherits A's assignees (i.e., Adam).

Issue A (Adam)
Issue B (Adam)

Issue B is now un-marked as duplicate of A -> EDIT: Issue B's current assignees are removed. It no longer has any assignees. Issue B will keep assignees it inherited from issue A.

Issue A (Adam)
Issue B (Adam)

@yucongkoo
Copy link
Copy Markdown
Contributor Author

@damithc
When you unmark issue B as a duplicate of Issue A, the assignees of issue B will be kept as the assignees of Issue A, so Adam in the provided scenario.

Same applies to the labels.

@damithc
Copy link
Copy Markdown
Contributor

damithc commented Mar 24, 2025

@damithc When you unmark issue B as a duplicate of Issue A, the assignees of issue B will be kept as the assignees of Issue A, so Adam in the provided scenario.

Same applies to the labels.

Got it. Yeah, that makes sense. I updated my comment to reflect this.

@yucongkoo
Copy link
Copy Markdown
Contributor Author

yucongkoo commented Mar 24, 2025

@damithc
Yup the updated scenario is the current behaviour.

The fix included in this PR is for the behaviour when we click on the edit assignees icon.

Behaviour before the fix:
After Issue B is unmarked as a duplicate, it is still assigned to Adam.
If we click edit assignees, the dropdown will show Betsy (the original assignee to Issue B) is selected.

Behaviour after the fix:
After Issue B is unmarked as a duplicate, it is still assigned to Adam.
If we click edit assignees, the dropdown will show Adam is selected.

Copy link
Copy Markdown
Contributor

@Arif-Khalid Arif-Khalid left a comment

Choose a reason for hiding this comment

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

Great change and great PR, working as intended.
Effort is clear in investigation and effective, concise resolution of the issue.
Just a minor change required to align with Angular standards.

this.assignees = this.issue.assignees.map((a) => a);
}

ngOnChanges(changes: SimpleChanges) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As warned by the github actions, please inherit from the OnChanges interface

Copy link
Copy Markdown
Contributor

@Arif-Khalid Arif-Khalid left a comment

Choose a reason for hiding this comment

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

LGTM! 🤓

@Arif-Khalid Arif-Khalid merged commit f19462d into CATcher-org:master Mar 24, 2025
5 checks passed
@yucongkoo yucongkoo deleted the 1348-issue-with-reassigning-assignees-after-unchecking-issue-as-duplicate branch April 7, 2025 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with reassigning assignees after unchecking issue as duplicate

3 participants