Skip to content

fix: remove not relevant user tags when replacing users - #3891

Merged
web-padawan merged 2 commits into
masterfrom
fix/field-highlighter/set-users
May 23, 2022
Merged

web-padawan merged 2 commits into
masterfrom
fix/field-highlighter/set-users

Conversation

@vursen

@vursen vursen commented May 19, 2022 •

Copy link
Copy Markdown
Contributor

Description

The PR adds the missing logic for removing no longer relevant user tags when setting a new set of users with setUsers:

// Added: user1, user2
FieldHighlighter.setUsers(field, [user1, user2]); 

// Removed: user1, user2 <----- previously they could remain in the DOM
// Added: user3
FieldHighlighter.setUsers(field, [user3]); 

Fixes #3878

Type of change

  • Bugfix

Checklist

  • I have read the contribution guide: https://vaadin.com/docs-beta/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

@vursen
vursen marked this pull request as draft May 19, 2022 13:11
@vursen vursen changed the title fix: don't render old user tags when replacing users (WIP) fix: remove old user tags when replacing users (WIP) May 19, 2022
@vursen vursen changed the title fix: remove old user tags when replacing users (WIP) fix: remove not relevant user tags when replacing users (WIP) May 19, 2022
expect(tags.length).to.equal(2);
});

it('should replace user tags when replacing users', async () => {

@vursen vursen May 19, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note: This test targets the issue.

expect(tags.length).to.equal(1);
});

it('should replace user tags when replacing users', async () => {

@vursen vursen May 19, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note: This test was not failing. Added it for the consistency.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vursen
vursen requested a review from web-padawan May 23, 2022 09:22
@vursen
vursen marked this pull request as ready for review May 23, 2022 09:23
@vursen vursen changed the title fix: remove not relevant user tags when replacing users (WIP) fix: remove not relevant user tags when replacing users May 23, 2022
@web-padawan
web-padawan merged commit 269b084 into master May 23, 2022
@web-padawan
web-padawan deleted the fix/field-highlighter/set-users branch May 23, 2022 09:44
@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @vursen , this commit cannot be picked to 23.0 by this bot, can you take a look and pick it manually?
Error Message: Error: Command failed: git cherry-pick 269b084
error: could not apply 269b084... fix: remove not relevant user tags when replacing users (#3891)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 23.1.0.rc1 and is also targeting the upcoming stable 23.1.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[field-highlighter] When setting new users, the old ones keep rendered on hover and focus

3 participants