-
Notifications
You must be signed in to change notification settings - Fork 16
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
IBX-9170: AI Assistant #1385
base: 4.6
Are you sure you want to change the base?
IBX-9170: AI Assistant #1385
Conversation
b11091b
to
b242305
Compare
42c2d1a
to
60e8ef7
Compare
60e8ef7
to
28e8501
Compare
25325d8
to
990cbc0
Compare
onClose: () => {}, | ||
onItemClick: () => {}, | ||
positionOffset: () => ({ x: 0, y: 0 }), | ||
scrollContainer: window.document.body, |
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.
Could you use helper function getRootDOMElement from https://github.com/ibexa/admin-ui/blob/main/src/bundle/Resources/public/js/scripts/helpers/context.helper.js#L62 ?
&__item-content { | ||
position: relative; | ||
display: flex; | ||
align-items: center; |
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.
duplicated align-items
cursor: pointer; | ||
padding: calculateRem(9px); | ||
color: $ibexa-color-dark; | ||
font-size: calculateRem(14px); |
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.
we have variable for font-size
&:disabled, | ||
&--disabled { | ||
pointer-events: none; | ||
cursor: not-allowed; |
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.
pointer-events: none and cursor: not-allowed, is it working together?
|
||
useEffect(() => { | ||
if (isDragging) { | ||
rootDOMElement.addEventListener('mousemove', handleDragging); |
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.
rootDOMElement.addEventListener('mousemove', handleDragging); | |
rootDOMElement.addEventListener('mousemove', handleDragging, false); |
just for consistency
|
||
rootDOMElement.classList.add('ibexa-react-root'); | ||
|
||
if (id) { |
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.
maybe we should check if there is no repetition of the ID in document?
return null; | ||
} | ||
|
||
const groupClassName = createCssClassNames({ |
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'm not sure if we should use createCssClassNames
because this it's only one class and it's not conditional
@@ -0,0 +1,24 @@ | |||
const createDynamicRoot = (contextDOMElement = window.document.body, id) => { |
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.
window.document.body
you can get this object by function getRootDOMElement
from https://github.com/ibexa/admin-ui/blob/main/src/bundle/Resources/public/js/scripts/helpers/context.helper.js. We will avoid possible problems in the future if this code is used outside DXP
onClose(); | ||
}; | ||
|
||
window.document.body.addEventListener('click', onInteractionOutside, 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.
please use getRootDOMElement
scrollContainer.addEventListener('scroll', calculateAndSetItemsListStyles, false); | ||
|
||
return () => { | ||
window.document.body.removeEventListener('click', onInteractionOutside); |
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.
please use getRootDOMElement
Quality Gate passedIssues Measures |
Description:
This PR provides two reusable react components - draggable dialog (that will be used for AI assistant) and popup menu (based a little on dropdown component, using similar styles as popup menu from vanilla JS)
For QA:
Documentation: