Skip to content
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

Unchecked the agents when you click outside #2907

Merged
merged 5 commits into from Feb 4, 2021

Conversation

pablomarga
Copy link
Contributor

Hi team, this PR solved the problem that agents were not unchecked when switching from Available agents to Current agents in Management > Groups.
Closes #2889

@pablomarga pablomarga requested a review from a team February 2, 2021 18:22
@@ -498,6 +498,9 @@ export class MultipleAgentSelector extends Component {
size='15'
multiple
onChange={(e) => {
document.getElementById("wzMultipleSelectorRight").childNodes.forEach(option => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you put all of this code in a new method and maybe you can reuse the method with param wzMultipleSelectorRight/wzMultipleSelectorLeft

Copy link
Contributor

@gabiwassan gabiwassan left a comment

Choose a reason for hiding this comment

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

LGTM

@pablomarga pablomarga self-assigned this Feb 3, 2021
Comment on lines 347 to 359
unselectLeftRight(element) {
switch (element) {
case 'left':
return document.getElementById("wzMultipleSelectorLeft").childNodes.forEach(option => {
option.selected = false
})
case 'right':
return document.getElementById("wzMultipleSelectorRight").childNodes.forEach(option => {
option.selected = false
})
}
}

Copy link
Member

@Desvelao Desvelao Feb 3, 2021

Choose a reason for hiding this comment

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

Why not use the container id as the param. You could simplify to:

unselectElementsOfSelectByID(containerID) {
  document.getElementById(containerID).selectedOptions.forEach(option => {
    option.selected = false
  });
}

A more descriptive name for the function will better.

Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

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

LGTM!

@frankeros frankeros merged commit ead73cc into 4.1-7.10 Feb 4, 2021
@frankeros frankeros deleted the fixed/selected-agents-unchecked branch February 4, 2021 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants