-
Notifications
You must be signed in to change notification settings - Fork 90
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
[SALAD-23962] Add machine table dropdown menu #1270
base: master
Are you sure you want to change the base?
Conversation
rners01
commented
Jan 30, 2025
7a41318
to
a302d8d
Compare
<FontAwesomeIcon icon={faList} /> | ||
<Dropdown | ||
control={<FontAwesomeIcon size="xl" icon={faList} />} | ||
options={[ |
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.
Let's move options in separate constant
@@ -108,7 +109,28 @@ const _AllMachines = ({ classes }: Props) => { | |||
const getTitles = () => { | |||
return [ | |||
<div className={(classes.tableHeaderCell, classes.tableCellCentered)}> | |||
<FontAwesomeIcon icon={faList} /> | |||
<Dropdown |
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.
It didn't select items. Will this functionality be added in the following PR?
0b192bd
to
eb5e222
Compare
const beginningIndex = (currentPageNumber - 1) * itemsPerPageAmount | ||
const endingIndex = currentPageNumber * itemsPerPageAmount | ||
const machinesToSelect = generatedMockedMachines | ||
.slice(beginningIndex, endingIndex) | ||
.reduce((acc, machine) => ({ ...acc, [machine.id]: true }), {}) |
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.
let's keep it completely aligned with usePagination()
hook values.
const beginningIndex = (currentPageNumber - 1) * itemsPerPageAmount | |
const endingIndex = currentPageNumber * itemsPerPageAmount | |
const machinesToSelect = generatedMockedMachines | |
.slice(beginningIndex, endingIndex) | |
.reduce((acc, machine) => ({ ...acc, [machine.id]: true }), {}) | |
const machinesToSelect = generatedMockedMachines | |
.slice(lowestItemNumberOnPage - 1, highestItemNumberOnPage) | |
.reduce((acc, machine) => ({ ...acc, [machine.id]: true }), {}) |
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.
done
const beginningIndex = (currentPageNumber - 1) * itemsPerPageAmount | ||
const endingIndex = currentPageNumber * itemsPerPageAmount | ||
const machinesToDeselect = generatedMockedMachines | ||
.slice(beginningIndex, endingIndex) | ||
.reduce((acc, machine) => ({ ...acc, [machine.id]: false }), {}) |
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.
let's keep it completely aligned with usePagination()
hook values.
const beginningIndex = (currentPageNumber - 1) * itemsPerPageAmount | |
const endingIndex = currentPageNumber * itemsPerPageAmount | |
const machinesToDeselect = generatedMockedMachines | |
.slice(beginningIndex, endingIndex) | |
.reduce((acc, machine) => ({ ...acc, [machine.id]: false }), {}) | |
const machinesToDeselect = generatedMockedMachines | |
.slice(lowestItemNumberOnPage - 1, highestItemNumberOnPage) | |
.reduce((acc, machine) => ({ ...acc, [machine.id]: false }), {}) |
eb5e222
to
8bcbc3c
Compare
8bcbc3c
to
ad570be
Compare
customStyles?: DropdownStylesConfig | ||
options?: DropdownOption[] | ||
value?: string | ||
isSearchable?: boolean |
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.
why do we need this functionality?