-
-
Notifications
You must be signed in to change notification settings - Fork 142
BUGFIX: Resolve issue with custom data source displaying additional l… #3701
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
Conversation
For easier testing here my DataSource: <?php
namespace Neos\Demo\Service\DataSource;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Persistence\PersistenceManagerInterface;
use Neos\Neos\Domain\Service\UserService;
use Neos\Neos\Service\DataSource\AbstractDataSource;
use Neos\ContentRepository\Domain\Model\NodeInterface;
class EditorsDataSource extends AbstractDataSource
{
/**
* @var string
*/
static protected $identifier = 'neos-demo-editors';
/**
* @Flow\Inject
* @var UserService
*/
protected $userService;
/**
* @Flow\Inject
* @var PersistenceManagerInterface
*/
protected $persistenceManager;
/**
* @param NodeInterface $node The node that is currently edited (optional)
* @param array $arguments Additional arguments (key / value)
* @return array
*/
public function getData(NodeInterface $node = null, array $arguments = [])
{
$options = [];
foreach ($this->userService->getUsers() as $user) {
$options[] = [
'value' => $this->persistenceManager->getIdentifierByObject($user),
'label' => $user->getLabel(),
// additional optional parameters:
'secondaryLabel' => "works here",
'tertiaryLabel' => "is a nice person",
'preview' => 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA0NDggNTEyJz48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNS4xIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjQgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZD0nTTIyNCAxNmMtNi43IDAtMTAuOC0yLjgtMTUuNS02LjFDMjAxLjkgNS40IDE5NCAwIDE3NiAwYy0z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
type: array
ui:
label: 'Author(s)'
reloadIfChanged: true
inspector:
group: 'document'
position: '200'
editor: Neos.Neos/Inspector/Editors/SelectBoxEditor
editorOptions:
placeholder: Choose
dataSourceIdentifier: neos-demo-editors |
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.
Thx, looks better (though I don't like the image hanging loose there, which is not a problem of this PR), but this change needs a cleaner CSS implementation.
packages/react-ui-components/src/SelectBox_Option_MultiLineWithThumbnail/style.css
Show resolved
Hide resolved
@@ -1,8 +1,25 @@ | |||
.multiLineWithThumbnail__item { | |||
display: grid; | |||
grid-template-columns: auto 1fr; | |||
gap: -var(--spacing-Half); |
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 negative gap is marked as invalid value and also doesn't seem to have any effect.
The styling would also be simpler when the gap is actually used and the padding of the element disabled and therefore the image correctly positioned (also the image margin needs to be disabled.
The result is looking the same but without all the CSS pushing around.
…abels incorrectly Previously, there was an issue with the custom data source where the secondary label, utilized with label and preview, was not being displayed correctly. This commit addresses the problem, ensuring proper alignment and display of the secondary label in conjunction with the label and preview elements. The implementation includes the use of a CSS grid layout to achieve consistent and accurate rendering of the custom data source information. Fixes: neos#3675
Long labels float out of the container and do not look nice. This adds an ellipsis and the tooltip is always available on hover to read the whole text. The Image is now also aligned in centered position.
54a17ae
to
7857554
Compare
🎥 End-to-End Test Recordings These videos demonstrate the end-to-end tests for the changes in this pull request. |
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.
Great much better!
margin-left: -var(--spacing-Full); | ||
margin-top: -var(--spacing-Half); | ||
margin-bottom: -var(--spacing-Half); | ||
margin-left: -var(--spacing-Half); |
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.
Not so happy about still having a negative margin, but I think its fine for now.
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.
Yeah, but in the select boxes I am always afraid that I break something else 🙈
Previously, there was an issue with the custom data source where the secondary label, utilized with label and preview, was not being displayed correctly. This commit addresses the problem, ensuring proper alignment and display of the secondary label in conjunction with the label and preview elements. The implementation includes the use of a CSS grid layout to achieve consistent and accurate rendering of the custom data source information.
Fixes: #3675
Before:

After with preview:

After without preview and 3rd label:
