Commit fbb06b22 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov
Browse files

Merge branch '619-include-exclude-icon-does-not-changes' into 'master'

Include/Exclude icon does not changes

Closes #619

See merge request genesys-pgr/genesys-ui!601
parents 8eefa17e f080ae5a
......@@ -67,19 +67,26 @@ class StringList extends React.Component<IStringListProps> {
const {renderList} = this.state;
const newRenderList = [];
renderList.map((renderItem) => {
if (doList.indexOf(renderItem.value) !== -1 || notList.indexOf(renderItem.value) !== -1) {
renderList.forEach((renderItem) => {
const doListIndex = doList.indexOf(renderItem.value);
const notListIndex = notList.indexOf(renderItem.value);
if (doListIndex !== -1 && renderItem.state) {
newRenderList.push(renderItem);
}
if (notListIndex !== -1 && !renderItem.state) {
newRenderList.push(renderItem);
}
});
doList
.filter((doItem) => newRenderList.findIndex((renderItem) => renderItem.value === doItem) === -1)
.map((doItem) => newRenderList.push({value: doItem, state: true}));
.forEach((doItem) => newRenderList.push({value: doItem, state: true}));
notList
.filter((notItem) => newRenderList.findIndex((renderItem) => renderItem.value === notItem) === -1)
.map((notItem) => newRenderList.push({value: notItem, state: false}));
.forEach((notItem) => newRenderList.push({value: notItem, state: false}));
this.setState({renderList: newRenderList});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment