-
Notifications
You must be signed in to change notification settings - Fork 15
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-2925: [D&D] Functionality and design improvements #435
Conversation
@@ -120,6 +127,12 @@ | |||
group.reinit(); | |||
}); | |||
}; | |||
const insertFieldDefinitionNode = (fieldNode) => { | |||
const fieldDefinitionNode = createFieldDefinitionNode(fieldNode); |
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.
const fieldDefinitionNode = createFieldDefinitionNode(fieldNode); | |
const fieldDefinitionNode = createFieldDefinitionNode(fieldNode); | |
insertFieldDefinitionNode(response); | ||
afterChangeGroup(); | ||
}) | ||
.catch(ibexa.helpers.notification.showErrorNotification); | ||
.catch((error) => { | ||
const field = doc.querySelector('.ibexa-collapse--field-definition-loading'); |
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.
const field = doc.querySelector('.ibexa-collapse--field-definition-loading'); | |
const field = doc.querySelector('.ibexa-collapse--field-definition-loading'); | |
const field = doc.querySelector('.ibexa-collapse--field-definition-loading'); | ||
setErrorField(field); | ||
ibexa.helpers.notification.showErrorNotification(error); | ||
}); | ||
}; | ||
const reorderFields = () => { | ||
insertFieldDefinitionNode(currentDraggedItem); | ||
|
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.
const targetContainerGroup = targetContainer.closest('.ibexa-collapse--field-definitions-group'); | ||
const targetContainerList = targetContainerGroup.closest('.ibexa-content-type-edit__field-definitions-group-list'); | ||
const fieldTemplate = targetContainerList.dataset.template.replace('{{ type }}', currentDraggedItem.dataset.itemIdentifier); |
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.
const fieldTemplate = targetContainerList.dataset.template.replace('{{ type }}', currentDraggedItem.dataset.itemIdentifier); | |
const fieldTemplate = targetContainerList.dataset.template; | |
const fieldRendered = fieldTemplate.replace('{{ type }}', currentDraggedItem.dataset.itemIdentifier); |
?
return false; | ||
} | ||
|
||
// 0 makes that item is always inserted before anchored placeholder |
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.
// 0 makes that item is always inserted before anchored placeholder |
@@ -432,6 +534,7 @@ | |||
draggable.init(); | |||
draggableGroups.push(draggable); | |||
}); | |||
fieldDefinitionsGroups.forEach((group) => group.addEventListener('click', () => setActiveGroup(group))); |
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.
fieldDefinitionsGroups.forEach((group) => group.addEventListener('click', () => setActiveGroup(group))); | |
fieldDefinitionsGroups.forEach((group) => group.addEventListener('click', () => setActiveGroup(group), false)); |
'is_expanded': false, | ||
'is_draggable': true, | ||
'class': 'ibexa-collapse--field-definition ibexa-collapse--field-definition-highlight ibexa-collapse--field-definition-loading', | ||
'body_id': 'loading_collapse', |
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.
'body_id': 'loading_collapse', | |
'body_id': 'loading-collapse', |
bc08e89
to
a1e7f10
Compare
src/bundle/Resources/views/themes/admin/content_type/field_definitions.html.twig
Show resolved
Hide resolved
6bc76e4
to
bf9ba83
Compare
33e828f
to
7fad749
Compare
src/bundle/Resources/public/js/scripts/admin.contenttype.edit.js
Outdated
Show resolved
Hide resolved
src/bundle/Resources/public/js/scripts/admin.contenttype.edit.js
Outdated
Show resolved
Hide resolved
src/bundle/Resources/public/js/scripts/admin.contenttype.edit.js
Outdated
Show resolved
Hide resolved
class="ibexa-available-field-type" | ||
data-item-identifier="{{ item.identifier }}" | ||
> | ||
<div |
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.
indent?
and
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.
in this case, these are field types in right sidebar, this element always stay in its place, as you can add it multiple times
@@ -28,7 +28,7 @@ | |||
{% if extra_actions is defined %} | |||
{% for action in extra_actions %} | |||
<button type="button" class="ibexa-collapse__extra-action-button btn ibexa-btn ibexa-btn--no-text {{ action.button_class|default('') }}"> | |||
<svg class="ibexa-icon ibexa-icon--small"> | |||
<svg class="ibexa-icon {{ action.icon_size_class|default('ibexa-icon--small') }}"> |
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.
A thought: icon_size_class
seems to lack flexibility in case of future changes and new variables.
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.
Do you think it would be better to do
<svg class="{{ action.icon_class|default('ibexa-icon ibexa-icon--small') }}">
and later pass 'icon_class': 'ibexa-icon ibexa-icon--tiny-small',
? Or treat ibexa-icon
as class that is always and only change icon_size_class
to icon_class
?
} | ||
} | ||
|
||
&--is-highlighted { |
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.
Whereas I understand that "action" classes like --is-dragging-out
sound better with is
, here and in other "non-action" classes below it is not needed in my opinion and it is not consistent with our other classes.
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.
There are some issues, I will list all on this PR
1. Content Types
- make d&d icon black when hover (in all d&d places)
- when editing Content Type unnecessary grey background at the end
- field is "jumping" when adding it by click, see https://recordit.co/80Aj0VjDOv
2. Attributes in PC
- blue shadow when hover attribute
-
when d&d all attribute group, attributes are not listed, cannot remove it, see please: https://recordit.co/xgclZ2BJyk
-
when d&d attribute(the only or last one) attribute group is still visible, after removing attribute it is not visible on the list again, see https://recordit.co/JB3CWGeF0s
- blue background, no animations
4. Page Builder
- no blue highlight after dropping element
- no grey highlight after removing element, waiting for server response
- no animation of removing element
- issue when wrapping groups, see please: https://recordit.co/HcOlaG408y
5. Form Builder
- issue when wrapping groups, see please: https://recordit.co/TXAIRCEk5d
e94b76b
to
329bf0a
Compare
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.
There are still some issues.
- When adding two fields quickly(when blue highlight is visible) error occurs https://recordit.co/QJgTgqD0hW
- Blue indicator is not visible when adding a second or additional field https://recordit.co/sqDPluh9r0
- Cannot quickly remove field from Form Builder https://recordit.co/xsqN5rKESh
- Perso: missing blue indicator and remove animation https://recordit.co/zRRMgtVxqZ
7e7aad9
to
cdd5fb9
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Checklist:
$ composer fix-cs
)