-
Notifications
You must be signed in to change notification settings - Fork 8
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
Selection after search #333
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/* Ensure that the search input is cleared */ | ||
const inputSearch = await page.locator('.ant-input-affix-wrapper'); | ||
await inputSearch.getByPlaceholder(/search/i).fill(''); | ||
|
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.
When testing with moving into a folder, a check for being in the root folder before deleting could be beneficial, however, then the deletion loop needs to keep track of the processes to delete (deleting a folder deletes everything within it, therefore all ids within it should be removed from processListPage.processDefinitionIds
or processListPage.folderIds
as well).
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…to true when the required data is missing
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
return [...new ObjectSetArray([...oldSelection, ...changeRows], 'id')] as T[]; | ||
} else { | ||
return [ | ||
...new ObjectSetArray( | ||
oldSelection.filter( | ||
({ id }) => !changeRows.some(({ id: rowId }) => rowId === id), | ||
), | ||
'id', | ||
), | ||
] as T[]; |
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.
That seems very complex for this use-case. Maybe using the built-in Set
can implement this behaviour. Something like this:
function getUniqueObjects(array, ids) {
const uniqueSet = new Set();
const uniqueArray = [];
for (const obj of array) {
const key = JSON.stringify(Object.fromEntries(ids.map(id => [id, obj[id]])));
if (!uniqueSet.has(key)) {
uniqueSet.add(key);
uniqueArray.push(obj);
}
}
return uniqueArray;
}
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.
Did just that, although I think that the implemented ObjectSetArray holds nice additional array like utilities, I agree, that it is overkill here.
'process-list', | ||
'del', | ||
() => { | ||
console.log('Hello World', canDeleteSelected); |
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.
Can be removed?
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 comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Successfully created Preview Deployment. |
Summary
Details
add
andhas