Skip to content

OBPIH-7251 Fixed position columns and horizontal scrolling for new react tables#5244

Merged
awalkowiak merged 7 commits intoOBPIH-7241from
OBPIH-7251-4
May 12, 2025
Merged

OBPIH-7251 Fixed position columns and horizontal scrolling for new react tables#5244
awalkowiak merged 7 commits intoOBPIH-7241from
OBPIH-7251-4

Conversation

@SebastianLib
Copy link
Collaborator

✨ Description of Change

Link to GitHub issue or Jira ticket:

Description:
image

1376 px:
image


📷 Screenshots & Recordings (optional)

Comment on lines 42 to 52
const [isScreenWiderThanTable, setIsScreenWiderThanTable] = useState(false);
const totalSize = table.getTotalSize();
useEffect(() => {
const handleResize = () => {
setIsScreenWiderThanTable(window.innerWidth > totalSize);
};
handleResize();
window.addEventListener('resize', handleResize);
return () => window.removeEventListener('resize', handleResize);
}, [totalSize]);

Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't it a candidate for a hook?

Comment on lines 5 to 16
let boxShadow;
let clipPath;
let marginRight;
if (isLastLeftPinnedColumn) {
boxShadow = '0 0 15px #00000040';
clipPath = 'inset(0 -15px 0 0)';
marginRight = '5px';
} else {
boxShadow = undefined;
clipPath = undefined;
marginRight = undefined;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

can't you use ternary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I could use a ternary. I did it this way for now because in the docs they also use isPinned === 'right', which I haven’t added yet, so the if made more sense at this stage. But I’ll clean it up for now

Copy link
Collaborator

@alannadolny alannadolny left a comment

Choose a reason for hiding this comment

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

@SebastianLib, have you checked the other cycle count tables, right?

@SebastianLib
Copy link
Collaborator Author

@alannadolny yes of course, you can check my video in the ticket. Now I'm resolving conflicts

@github-actions github-actions bot added the domain: frontend Changes or discussions relating to the frontend UI label May 8, 2025
@SebastianLib SebastianLib requested a review from alannadolny May 8, 2025 13:05
RECORDED: 'date_counted',
// fix after getting appropriate property in response
TRANSACTION_ID: 'inventoryItem.id',
TRANSACTION_ID: 'inventory_item_id',
Copy link
Collaborator

@kchelstowski kchelstowski May 9, 2025

Choose a reason for hiding this comment

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

how is this change connected with the ticket? Is it something you fixed additionally or?
Btw. I am a bit scared of that change - could you provide the context and confirm this won't break anything?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed it after agreeing with Alan. It was because the getCommonPinningStyles function built into the react table column.getIsLastColumn('left') did not detect a column that had an id with a dot. It's hard to say if it will break anything in the future because the data is mocked for now

@SebastianLib SebastianLib requested a review from kchelstowski May 9, 2025 14:18
@awalkowiak awalkowiak merged commit a56ff72 into OBPIH-7241 May 12, 2025
5 of 6 checks passed
@awalkowiak awalkowiak deleted the OBPIH-7251-4 branch May 12, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: frontend Changes or discussions relating to the frontend UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants