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
Disable apply button at initial state and move agents to their original position #3605
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code performs the function required. Upon encountering an error, it reverts all the changes to its original state.
However, the way that it does so causes further errors to be logged into the console.
Examining the code in wzRequest
, it rejects the promise if the response contains failed_ids
, never updating the failedIds
array and causing the code to attempt and remove agents that do not belong in the group, causing the error.
public/components/management/groups/multiple-agent-selector.tsx
Outdated
Show resolved
Hide resolved
from.splice(idx, 1); | ||
item.type = !item.type ? type : ''; | ||
to.push(item) | ||
moveItem = (item, from, to, type) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This functions mutates the state. It doesn't seem to have been changed in this PR but it should be addressed in another issue
public/components/management/groups/multiple-agent-selector.tsx
Outdated
Show resolved
Hide resolved
public/components/management/groups/multiple-agent-selector.tsx
Outdated
Show resolved
Hide resolved
public/components/management/groups/multiple-agent-selector.tsx
Outdated
Show resolved
Hide resolved
Test: ❌ The expected result would be to show the successfully added agents in the right column and the ones that failed on the left. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error in console persists
public/components/management/groups/multiple-agent-selector.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just seen this bug, when you put the agent in a group, you move it back, saving all times and then try to enter the group another time, the button is disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test: ✔️
CR: ✔️
Possible minor improvements
<option | ||
key={index} | ||
className={ | ||
item.type === 'a' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible small Improvement: You could map classNames
with the item.type
so the className
prop of the option is easier to read.
like className={ typeClasses[item.type] }
<option | ||
key={index} | ||
className={ | ||
item.type === 'a' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible small Improvement: You could map classNames
with the item.type
so the className
prop of the option is easier to read.
like className={ typeClasses[item.type] }
public/components/management/groups/multiple-agent-selector.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR and Testing: LGTM!
Hi team!
When managing agents into a group generates an error, all the agents move to their original positions.
Also, the
Apply changes
button is disabled when all the agents are in their original position.To test it:
Solves: #3332