Skip to content

Instantly share code, notes, and snippets.

@patrickallaert
Created July 2, 2024 09:26
Show Gist options
  • Save patrickallaert/fac2a71bdb8006799e69bd5d3771ae01 to your computer and use it in GitHub Desktop.
Save patrickallaert/fac2a71bdb8006799e69bd5d3771ae01 to your computer and use it in GitHub Desktop.
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/Content/ContentTreeController.php vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/Content/ContentTreeController.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/Content/ContentTreeController.php 2024-07-02 10:19:28.412331807 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/Content/ContentTreeController.php 2024-07-02 10:23:24.950906973 +0200
@@ -8,34 +8,62 @@
namespace Ibexa\Bundle\AdminUi\Controller\Content;
+use Ibexa\AdminUi\Permission\LookupLimitationsTransformer;
use Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequestNode;
use Ibexa\AdminUi\REST\Value\ContentTree\Node;
+use Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo;
use Ibexa\AdminUi\REST\Value\ContentTree\Root;
+use Ibexa\AdminUi\Siteaccess\SiteaccessResolverInterface;
+use Ibexa\AdminUi\Specification\ContentType\ContentTypeIsUser;
use Ibexa\AdminUi\UI\Module\ContentTree\NodeFactory;
+use Ibexa\Contracts\AdminUi\Permission\PermissionCheckerInterface;
+use Ibexa\Contracts\Core\Limitation\Target;
use Ibexa\Contracts\Core\Repository\LocationService;
+use Ibexa\Contracts\Core\Repository\PermissionResolver;
+use Ibexa\Contracts\Core\Repository\Values\Content\Content;
+use Ibexa\Contracts\Core\Repository\Values\Content\Location;
use Ibexa\Contracts\Core\Repository\Values\Content\Query;
+use Ibexa\Contracts\Core\Repository\Values\User\Limitation;
+use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface;
use Ibexa\Rest\Message;
use Ibexa\Rest\Server\Controller as RestController;
use Symfony\Component\HttpFoundation\Request;
+/**
+ * @phpstan-import-type TPermissionRestrictions from \Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo
+ */
class ContentTreeController extends RestController
{
- /** @var \Ibexa\Contracts\Core\Repository\LocationService */
- private $locationService;
+ private LocationService $locationService;
- /** @var \Ibexa\AdminUi\UI\Module\ContentTree\NodeFactory */
- private $contentTreeNodeFactory;
+ private PermissionCheckerInterface $permissionChecker;
+
+ private LookupLimitationsTransformer $lookupLimitationsTransformer;
+
+ private NodeFactory $contentTreeNodeFactory;
+
+ private PermissionResolver $permissionResolver;
+
+ private ConfigResolverInterface $configResolver;
+
+ private SiteaccessResolverInterface $siteaccessResolver;
- /**
- * @param \Ibexa\Contracts\Core\Repository\LocationService $locationService
- * @param \Ibexa\AdminUi\UI\Module\ContentTree\NodeFactory $contentTreeNodeFactory
- */
public function __construct(
LocationService $locationService,
- NodeFactory $contentTreeNodeFactory
+ PermissionCheckerInterface $permissionChecker,
+ LookupLimitationsTransformer $lookupLimitationsTransformer,
+ NodeFactory $contentTreeNodeFactory,
+ PermissionResolver $permissionResolver,
+ ConfigResolverInterface $configResolver,
+ SiteaccessResolverInterface $siteaccessResolver
) {
$this->locationService = $locationService;
+ $this->permissionChecker = $permissionChecker;
+ $this->lookupLimitationsTransformer = $lookupLimitationsTransformer;
$this->contentTreeNodeFactory = $contentTreeNodeFactory;
+ $this->permissionResolver = $permissionResolver;
+ $this->configResolver = $configResolver;
+ $this->siteaccessResolver = $siteaccessResolver;
}
/**
@@ -104,12 +132,164 @@
true,
0,
$sortClause,
- $sortOrder
+ $sortOrder,
+ $loadSubtreeRequest->filter,
);
}
return new Root($elements);
}
+
+ /**
+ * @internal for internal use by this package
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ public function loadNodeExtendedInfoAction(Location $location): NodeExtendedInfo
+ {
+ $locationPermissionRestrictions = $this->getLocationPermissionRestrictions($location);
+
+ $content = $location->getContent();
+ $versionInfo = $content->getVersionInfo();
+ $translations = $versionInfo->languageCodes;
+ $previewableTranslations = array_filter(
+ $translations,
+ fn (string $languageCode): bool => $this->isPreviewable($location, $content, $languageCode)
+ );
+
+ return new NodeExtendedInfo($locationPermissionRestrictions, $previewableTranslations);
+ }
+
+ /**
+ * @return TPermissionRestrictions
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function getLocationPermissionRestrictions(Location $location): array
+ {
+ $lookupCreateLimitationsResult = $this->permissionChecker->getContentCreateLimitations($location);
+ $lookupUpdateLimitationsResult = $this->permissionChecker->getContentUpdateLimitations($location);
+
+ $createLimitationsValues = $this->lookupLimitationsTransformer->getGroupedLimitationValues(
+ $lookupCreateLimitationsResult,
+ [Limitation::CONTENTTYPE, Limitation::LANGUAGE]
+ );
+
+ $updateLimitationsValues = $this->lookupLimitationsTransformer->getGroupedLimitationValues(
+ $lookupUpdateLimitationsResult,
+ [Limitation::LANGUAGE]
+ );
+
+ return [
+ 'create' => [
+ 'hasAccess' => $lookupCreateLimitationsResult->hasAccess(),
+ 'restrictedContentTypeIds' => $createLimitationsValues[Limitation::CONTENTTYPE],
+ 'restrictedLanguageCodes' => $createLimitationsValues[Limitation::LANGUAGE],
+ ],
+ 'edit' => [
+ 'hasAccess' => $lookupUpdateLimitationsResult->hasAccess(),
+ // skipped content type limitation values as in this case it can be inferred from "hasAccess" above
+ 'restrictedLanguageCodes' => $updateLimitationsValues[Limitation::LANGUAGE],
+ ],
+ 'delete' => [
+ 'hasAccess' => $this->canUserRemoveContent($location),
+ // skipped other limitation values due to performance, until really needed
+ ],
+ 'hide' => [
+ 'hasAccess' => $this->canUserHideContent($location),
+ // skipped other limitation values due to performance, until really needed
+ ],
+ ];
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ */
+ private function canUserRemoveContent(Location $location): bool
+ {
+ $content = $location->getContent();
+ $contentType = $content->getContentType();
+ $contentIsUser = (new ContentTypeIsUser($this->configResolver->getParameter('user_content_type_identifier')))
+ ->isSatisfiedBy($contentType);
+
+ $translations = $content->getVersionInfo()->getLanguageCodes();
+ $target = (new Target\Version())->deleteTranslations($translations);
+
+ if ($contentIsUser) {
+ return $this->permissionResolver->canUser(
+ 'content',
+ 'remove',
+ $content,
+ [$target]
+ );
+ }
+
+ if ($location->depth > 1) {
+ return $this->permissionResolver->canUser(
+ 'content',
+ 'remove',
+ $location->getContentInfo(),
+ [$location, $target]
+ );
+ }
+
+ return false;
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ */
+ private function canUserHideContent(Location $location): bool
+ {
+ $content = $location->getContent();
+
+ $translations = $content->getVersionInfo()->getLanguageCodes();
+ $target = (new Target\Version())->deleteTranslations($translations);
+
+ return $this->permissionResolver->canUser(
+ 'content',
+ 'hide',
+ $content,
+ [$target]
+ );
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ */
+ private function isPreviewable(
+ Location $location,
+ Content $content,
+ string $languageCode
+ ): bool {
+ $canPreview = $this->permissionResolver->canUser(
+ 'content',
+ 'versionread',
+ $content,
+ [$location]
+ );
+
+ if (!$canPreview) {
+ return false;
+ }
+
+ $versionNo = $content->getVersionInfo()->getVersionNo();
+
+ $siteAccesses = $this->siteaccessResolver->getSiteAccessesListForLocation(
+ $location,
+ $versionNo,
+ $languageCode
+ );
+
+ return !empty($siteAccesses);
+ }
}
class_alias(ContentTreeController::class, 'EzSystems\EzPlatformAdminUiBundle\Controller\Content\ContentTreeController');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/ContentTypeController.php vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/ContentTypeController.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/ContentTypeController.php 2024-07-02 10:19:28.412331807 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/ContentTypeController.php 2024-07-02 10:23:24.950906973 +0200
@@ -692,6 +692,18 @@
ContentType $contentType,
Request $request
): Response {
+ $contentTypeGroups = $contentType->getContentTypeGroups();
+ $contentTypeGroupsIds = array_column($contentTypeGroups, 'id');
+ if (!in_array($group->id, $contentTypeGroupsIds, true)) {
+ throw $this->createNotFoundException(
+ sprintf(
+ '%s content type does not belong to %s content type group.',
+ $contentType->getName(),
+ $group->identifier,
+ ),
+ );
+ }
+
$fieldDefinitionsByGroup = [];
foreach ($contentType->fieldDefinitions as $fieldDefinition) {
$fieldDefinitionsByGroup[$fieldDefinition->fieldGroup ?: 'content'][] = $fieldDefinition;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/ContentViewController.php vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/ContentViewController.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/ContentViewController.php 2024-07-02 10:19:28.412331807 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/ContentViewController.php 2024-07-02 10:23:24.951906975 +0200
@@ -172,6 +172,7 @@
$this->supplyContentType($view);
$this->supplyDraftPagination($view, $request);
+ $this->supplyRelationPagination($view, $request);
$this->supplyReverseRelationPagination($view, $request);
$this->supplyCustomUrlPagination($view, $request);
$this->supplySystemUrlPagination($view, $request);
@@ -357,6 +358,21 @@
],
]);
}
+
+ private function supplyRelationPagination(ContentView $view, Request $request): void
+ {
+ $page = $request->query->all('page');
+
+ $view->addParameters([
+ 'relation_pagination_params' => [
+ 'route_name' => $request->get('_route'),
+ 'route_params' => $request->get('_route_params'),
+ 'page' => $page['relation'] ?? 1,
+ 'pages_map' => $page,
+ 'limit' => $this->configResolver->getParameter('pagination.relation_limit'),
+ ],
+ ]);
+ }
/**
* @param \Ibexa\Core\MVC\Symfony\View\ContentView $view
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/DownloadImageController.php vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/DownloadImageController.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/DownloadImageController.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/DownloadImageController.php 2024-07-02 10:23:24.951906975 +0200
@@ -0,0 +1,320 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Bundle\AdminUi\Controller;
+
+use DateTimeImmutable;
+use Ibexa\Contracts\Core\Repository\SearchService;
+use Ibexa\Contracts\Core\Repository\Values\Content\Content;
+use Ibexa\Contracts\Core\Repository\Values\Content\Query;
+use Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult;
+use Ibexa\Core\FieldType\Image\Value;
+use Ibexa\Rest\Server\Controller;
+use Ibexa\User\UserSetting\DateTimeFormat\FormatterInterface;
+use RuntimeException;
+use Symfony\Component\HttpFoundation\HeaderUtils;
+use Symfony\Component\HttpFoundation\Response;
+use ZipArchive;
+
+final class DownloadImageController extends Controller
+{
+ private const EXTENSION_ZIP = '.zip';
+
+ private const ARCHIVE_NAME_PATTERN = 'images_%s' . self::EXTENSION_ZIP;
+
+ private int $downloadLimit;
+
+ private FormatterInterface $formatter;
+
+ /** @var array<string, mixed> */
+ private array $imageMappings;
+
+ private SearchService $searchService;
+
+ /**
+ * @param array<string, mixed> $imageMappings
+ */
+ public function __construct(
+ int $downloadLimit,
+ FormatterInterface $formatter,
+ array $imageMappings,
+ SearchService $searchService
+ ) {
+ $this->downloadLimit = $downloadLimit;
+ $this->formatter = $formatter;
+ $this->imageMappings = $imageMappings;
+ $this->searchService = $searchService;
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
+ * @throws \Exception
+ */
+ public function downloadAction(string $contentIdList): Response
+ {
+ $splitContentIdList = array_map(
+ static fn (string $value): int => (int)$value,
+ explode(',', $contentIdList)
+ );
+
+ $this->assertDownloadLimitNotExceeded($splitContentIdList);
+
+ $images = $this->loadImages($splitContentIdList);
+ if (0 === $images->totalCount) {
+ return new Response(
+ 'No results found.',
+ Response::HTTP_NOT_FOUND
+ );
+ }
+
+ return $this->processDownloading($images);
+ }
+
+ /**
+ * @param array<int> $contentIdList
+ */
+ private function assertDownloadLimitNotExceeded(array $contentIdList): void
+ {
+ if (count($contentIdList) > $this->downloadLimit) {
+ throw new RuntimeException(
+ sprintf(
+ 'Total download limit in one request is %d.',
+ $this->downloadLimit
+ )
+ );
+ }
+ }
+
+ /**
+ * @throws \Random\RandomException
+ * @throws \Exception
+ */
+ private function processDownloading(SearchResult $result): Response
+ {
+ if (1 === $result->totalCount) {
+ return $this->downloadSingleImage(
+ $result->getIterator()->current()->valueObject
+ );
+ }
+
+ if (!extension_loaded('zip')) {
+ throw new RuntimeException(
+ 'ZIP extension is not loaded. Enable the extension or use single download instead.'
+ );
+ }
+
+ $contentList = [];
+
+ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchHit $image */
+ foreach ($result as $image) {
+ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */
+ $content = $image->valueObject;
+ $contentList[] = $content;
+ }
+
+ return $this->downloadArchiveWithImages($contentList);
+ }
+
+ /**
+ * @throws \Random\RandomException
+ */
+ private function downloadSingleImage(Content $content): Response
+ {
+ $value = $this->getImageValue($content);
+ $uri = $this->getImageUri($value);
+
+ $content = file_get_contents($uri);
+ if (false === $content) {
+ throw new RuntimeException(
+ sprintf(
+ 'Failed to read data from "%s"',
+ $uri
+ )
+ );
+ }
+
+ $response = $this->createResponse(
+ $content,
+ $this->getImageFileName($value)
+ );
+
+ $response->headers->set('Content-Type', $value->mime);
+
+ return $response;
+ }
+
+ /**
+ * @param array<\Ibexa\Contracts\Core\Repository\Values\Content\Content> $contentList
+ *
+ * @throws \Random\RandomException
+ */
+ private function downloadArchiveWithImages(array $contentList): Response
+ {
+ $archiveName = sprintf(
+ self::ARCHIVE_NAME_PATTERN,
+ $this->generateRandomFileName()
+ );
+
+ $this->createArchive($archiveName, $contentList);
+
+ $content = file_get_contents($archiveName);
+ if (false === $content) {
+ throw new RuntimeException('Failed to read archive with images.');
+ }
+
+ $fileName = $this->formatter->format(new DateTimeImmutable()) . self::EXTENSION_ZIP;
+ $response = $this->createResponse($content, $fileName);
+ $response->headers->set('Content-Type', 'application/zip');
+
+ unlink($archiveName);
+
+ return $response;
+ }
+
+ private function getImageValue(Content $content): Value
+ {
+ $imageFieldIdentifier = $this->getImageFieldIdentifier($content->getContentType()->identifier);
+ $value = $content->getFieldValue($imageFieldIdentifier);
+
+ if (null === $value) {
+ throw new RuntimeException(
+ sprintf(
+ 'Missing field with identifier: "%s"',
+ $imageFieldIdentifier
+ )
+ );
+ }
+
+ if (!$value instanceof Value) {
+ throw new RuntimeException(
+ sprintf(
+ 'Field value should be of type %s. "%s" given.',
+ Value::class,
+ get_debug_type($value)
+ )
+ );
+ }
+
+ return $value;
+ }
+
+ private function getImageFieldIdentifier(string $contentTypeIdentifier): string
+ {
+ $imageFieldIdentifier = $this->imageMappings[$contentTypeIdentifier]['imageFieldIdentifier'];
+ if (null === $imageFieldIdentifier) {
+ throw new RuntimeException(
+ sprintf(
+ 'Missing key imageFieldIdentifier for content type mapping "%s".',
+ $contentTypeIdentifier
+ )
+ );
+ }
+
+ return $imageFieldIdentifier;
+ }
+
+ private function getImageUri(Value $value): string
+ {
+ $uri = $value->uri;
+ if (null === $uri) {
+ throw new RuntimeException('Missing image uri');
+ }
+
+ return ltrim($uri, '/');
+ }
+
+ /**
+ * @throws \Random\RandomException
+ */
+ private function getImageFileName(Value $value): string
+ {
+ return $value->fileName ?? 'image_' . $this->generateRandomFileName();
+ }
+
+ /**
+ * @param array<int> $contentIdList
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException;
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException;
+ */
+ private function loadImages(array $contentIdList): SearchResult
+ {
+ $query = new Query();
+ $query->filter = new Query\Criterion\LogicalAnd(
+ [
+ new Query\Criterion\ContentId($contentIdList),
+ new Query\Criterion\ContentTypeIdentifier($this->getContentTypeIdentifiers()),
+ ]
+ );
+ $query->limit = $this->downloadLimit;
+
+ return $this->searchService->findContent($query, [], false);
+ }
+
+ /**
+ * @return array<string>
+ */
+ private function getContentTypeIdentifiers(): array
+ {
+ $contentTypeIdentifiers = [];
+ foreach ($this->imageMappings as $contentTypeIdentifier => $mapping) {
+ $contentTypeIdentifiers[] = $contentTypeIdentifier;
+ }
+
+ return $contentTypeIdentifiers;
+ }
+
+ private function createResponse(
+ string $content,
+ string $fileName
+ ): Response {
+ $disposition = HeaderUtils::makeDisposition(
+ HeaderUtils::DISPOSITION_ATTACHMENT,
+ $fileName
+ );
+
+ return new Response(
+ $content,
+ 200,
+ [
+ 'Content-Disposition' => $disposition,
+ 'Content-Length' => strlen($content),
+ ]
+ );
+ }
+
+ /**
+ * @param array<\Ibexa\Contracts\Core\Repository\Values\Content\Content> $contentList
+ *
+ * @throws \Random\RandomException
+ */
+ private function createArchive(string $name, array $contentList): void
+ {
+ $zipArchive = new ZipArchive();
+ $zipArchive->open($name, ZipArchive::CREATE);
+
+ foreach ($contentList as $content) {
+ $value = $this->getImageValue($content);
+ $zipArchive->addFile(
+ $this->getImageUri($value),
+ $this->getImageFileName($value)
+ );
+ }
+
+ $zipArchive->close();
+ }
+
+ /**
+ * @throws \Random\RandomException
+ */
+ private function generateRandomFileName(): string
+ {
+ return bin2hex(random_bytes(12));
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/NotificationController.php vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/NotificationController.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/NotificationController.php 2024-07-02 10:19:28.412331807 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/NotificationController.php 2024-07-02 10:23:24.951906975 +0200
@@ -108,6 +108,7 @@
'page' => $page,
'pagination' => $pagination,
'notifications' => $notifications,
+ 'notifications_count_interval' => $this->configResolver->getParameter('notification_count.interval'),
'pager' => $pagerfanta,
])->getContent());
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/DependencyInjection/Configuration/Parser/Notifications.php vendor-4.6.7/ibexa/admin-ui/src/bundle/DependencyInjection/Configuration/Parser/Notifications.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/DependencyInjection/Configuration/Parser/Notifications.php 2024-07-02 10:19:28.412331807 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/DependencyInjection/Configuration/Parser/Notifications.php 2024-07-02 10:23:24.951906975 +0200
@@ -17,12 +17,14 @@
*
* Example configuration:
* ```yaml
- * ezpublish:
+ * ibexa:
* system:
* admin_group: # configuration per siteaccess or siteaccess group
* notifications:
* warning: # type of notification
* timeout: 5000 # in milliseconds
+ * notification_count:
+ * interval: 60000 # in milliseconds
* ```
*/
class Notifications extends AbstractParser
@@ -32,26 +34,31 @@
*/
public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
{
- if (empty($scopeSettings['notifications'])) {
- return;
- }
+ if (!empty($scopeSettings['notifications'])) {
+ $settings = $scopeSettings['notifications'];
+ $nodes = ['timeout'];
- $settings = $scopeSettings['notifications'];
- $nodes = ['timeout'];
+ foreach ($settings as $type => $config) {
+ foreach ($nodes as $key) {
+ if (!isset($config[$key]) || empty($config[$key])) {
+ continue;
+ }
- foreach ($settings as $type => $config) {
- foreach ($nodes as $key) {
- if (!isset($config[$key]) || empty($config[$key])) {
- continue;
+ $contextualizer->setContextualParameter(
+ sprintf('notifications.%s.%s', $type, $key),
+ $currentScope,
+ $config[$key]
+ );
}
-
- $contextualizer->setContextualParameter(
- sprintf('notifications.%s.%s', $type, $key),
- $currentScope,
- $config[$key]
- );
}
}
+ if (!empty($scopeSettings['notification_count']) && !empty($scopeSettings['notification_count']['interval'])) {
+ $contextualizer->setContextualParameter(
+ 'notification_count.interval',
+ $currentScope,
+ $scopeSettings['notification_count']['interval']
+ );
+ }
}
/**
@@ -70,6 +77,13 @@
->end()
->end()
->end()
+ ->end()
+ ->arrayNode('notification_count')
+ ->children()
+ ->scalarNode('interval')
+ ->info('Time in milliseconds between notification count refreshment.')
+ ->end()
+ ->end()
->end();
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/default_parameters.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/default_parameters.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/default_parameters.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/default_parameters.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -81,10 +81,17 @@
ibexa.site_access.config.default.admin_ui.default_focus_mode: '1'
- ibexa.dam_widget.image.field_definition_identifiers: [image]
- ibexa.dam_widget.image.content_type_identifiers: [image]
+ #### DAM WIDGET
+ ibexa.dam_widget.image.mappings:
+ image:
+ imageFieldIdentifier: image
+
ibexa.dam_widget.image.aggregations:
KeywordTermAggregation:
name: keywords
contentTypeIdentifier: image
fieldDefinitionIdentifier: tags
+
+ ibexa.dam_widget.image.download_limit: 25
+
+ ibexa.dam_widget.folder.content_type_identifier: folder
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/ezplatform_default_settings.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/ezplatform_default_settings.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/ezplatform_default_settings.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/ezplatform_default_settings.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -15,6 +15,7 @@
ibexa.site_access.config.admin_group.pagination.role_assignment_limit: 10
ibexa.site_access.config.admin_group.pagination.policy_limit: 10
ibexa.site_access.config.admin_group.pagination.version_draft_limit: 5
+ ibexa.site_access.config.admin_group.pagination.relation_limit: 10
ibexa.site_access.config.admin_group.pagination.reverse_relation_limit: 10
ibexa.site_access.config.admin_group.pagination.content_system_url_limit: 5
ibexa.site_access.config.admin_group.pagination.content_custom_url_limit: 5
@@ -43,6 +44,7 @@
ibexa.site_access.config.admin_group.subtree_operations.copy_subtree.limit: 100
# Notifications
+ ibexa.site_access.config.admin_group.notification_count.interval: 30000
ibexa.site_access.config.admin_group.notifications.error.timeout: 0
ibexa.site_access.config.admin_group.notifications.warning.timeout: 0
ibexa.site_access.config.admin_group.notifications.success.timeout: 5000
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/routing_rest.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/routing_rest.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/routing_rest.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/routing_rest.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -36,6 +36,13 @@
defaults:
_controller: 'Ibexa\Bundle\AdminUi\Controller\Content\ContentTreeController::loadSubtreeAction'
+ibexa.rest.location.tree.load_node_extended_info:
+ path: /location/tree/{locationId}/extended-info
+ methods: ['GET']
+ options:
+ expose: true
+ controller: 'Ibexa\Bundle\AdminUi\Controller\Content\ContentTreeController::loadNodeExtendedInfoAction'
+
#
# Content type create/edit form
#
@@ -112,3 +119,10 @@
methods: [GET]
options:
expose: true
+
+ibexa.rest.image.download:
+ path: /image/download/{contentIdList}
+ controller: 'Ibexa\Bundle\AdminUi\Controller\DownloadImageController::downloadAction'
+ methods: GET
+ requirements:
+ contentIdList: '^\d+(,\d+)*$'
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/controllers.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/controllers.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/controllers.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/controllers.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -244,3 +244,11 @@
autowire: true
tags:
- controller.service_arguments
+
+ Ibexa\Bundle\AdminUi\Controller\DownloadImageController:
+ arguments:
+ $downloadLimit: '%ibexa.dam_widget.image.download_limit%'
+ $formatter: '@ibexa.user.settings.full_datetime_format.formatter'
+ $imageMappings: '%ibexa.dam_widget.image.mappings%'
+ tags:
+ - controller.service_arguments
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/rest.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/rest.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/rest.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/rest.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -38,6 +38,11 @@
tags:
- { name: ibexa.rest.output.value_object.visitor, type: Ibexa\AdminUi\REST\Value\ContentTree\Root }
+ Ibexa\AdminUi\REST\Output\ValueObjectVisitor\ContentTree\NodeExtendedInfoVisitor:
+ parent: Ibexa\Contracts\Rest\Output\ValueObjectVisitor
+ tags:
+ - { name: ibexa.rest.output.value_object.visitor, type: Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo }
+
#
# Content type create/edit form
#
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/ui_config/common.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/ui_config/common.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/ui_config/common.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/ui_config/common.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -147,9 +147,10 @@
arguments:
$config:
image:
- fieldDefinitionIdentifiers: '%ibexa.dam_widget.image.field_definition_identifiers%'
- contentTypeIdentifiers: '%ibexa.dam_widget.image.content_type_identifiers%'
+ mappings: '%ibexa.dam_widget.image.mappings%'
aggregations: '%ibexa.dam_widget.image.aggregations%'
+ folder:
+ contentTypeIdentifier: '%ibexa.dam_widget.folder.content_type_identifier%'
tags:
- { name: ibexa.admin_ui.config.provider, key: 'damWidget' }
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_anchor-navigation.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_anchor-navigation.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_anchor-navigation.scss 2024-07-02 10:19:28.417331819 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_anchor-navigation.scss 2024-07-02 10:23:24.954906982 +0200
@@ -15,6 +15,10 @@
}
}
+ &__section-group-header {
+ padding: calculateRem(16px) 0;
+ }
+
&__section-header {
padding-top: calculateRem(64px);
margin-top: calculateRem(64px);
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_empty-chart.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_empty-chart.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_empty-chart.scss 2024-07-02 10:19:28.417331819 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_empty-chart.scss 2024-07-02 10:23:24.954906982 +0200
@@ -1,5 +1,5 @@
.ibexa-chart-no-data {
- padding: calculateRem(16px);
+ padding: calculateRem(48px) calculateRem(16px);
margin: 0;
&__wrapper {
@@ -16,4 +16,10 @@
font-family: $ibexa-font-family-headings;
color: $ibexa-color-dark-400;
}
+
+ &__img {
+ width: 50%;
+ max-width: calculateRem(400px);
+ max-height: calculateRem(200px);
+ }
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_extra-actions.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_extra-actions.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_extra-actions.scss 2024-07-02 10:19:28.417331819 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_extra-actions.scss 2024-07-02 10:23:24.954906982 +0200
@@ -138,7 +138,6 @@
}
&__section-content--content-type {
- padding: calculateRem(32px) 0 0 0;
border: none;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/fieldType/edit/_base-field.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/fieldType/edit/_base-field.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/fieldType/edit/_base-field.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/fieldType/edit/_base-field.scss 2024-07-02 10:23:24.954906982 +0200
@@ -128,6 +128,7 @@
left: 0;
z-index: 1080;
flex-direction: column;
+ flex-wrap: nowrap;
width: 100vw;
height: 100vh;
margin-top: 0;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_instant-filter.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_instant-filter.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_instant-filter.scss 2024-07-02 10:19:28.417331819 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_instant-filter.scss 2024-07-02 10:23:24.954906982 +0200
@@ -1,4 +1,12 @@
.ibexa-instant-filter {
+ &__input-wrapper {
+ margin-top: calculateRem(16px);
+
+ &--hidden {
+ display: none;
+ }
+ }
+
&__input {
display: block;
width: 100%;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_main-container.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_main-container.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_main-container.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_main-container.scss 2024-07-02 10:23:24.954906982 +0200
@@ -4,7 +4,7 @@
display: flex;
flex-wrap: nowrap;
overflow: hidden;
- height: calc(100vh - #{calculateRem(73px)});
+ height: calc(100vh - #{calculateRem(72px)});
&__content-column {
display: flex;
@@ -112,4 +112,9 @@
flex-direction: column;
flex: 1 1 80%;
}
+
+ ~ .ibexa-notifications-container {
+ right: calculateRem(48px);
+ bottom: calculateRem(16px);
+ }
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/mixins/_drag-and-drop.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/mixins/_drag-and-drop.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/mixins/_drag-and-drop.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/mixins/_drag-and-drop.scss 2024-07-02 10:23:24.954906982 +0200
@@ -1,3 +1,8 @@
+:root {
+ --ibexa-hover-color: var(--ibexa-hover-color, $ibexa-color-primary);
+ --ibexa-border-color: var(--ibexa-border-color, $ibexa-color-dark);
+}
+
@mixin drag-module-backdrop-background {
background-image: radial-gradient($ibexa-color-light 0.5px, transparent 0); // 0.5px is needed so that both on HD and Retina we have 1px
background-color: $ibexa-color-light-200;
@@ -290,11 +295,11 @@
cursor: pointer;
&:hover {
- color: $ibexa-color-primary;
+ color: var(--ibexa-hover-color);
#{$self}__toggler {
.ibexa-icon {
- fill: $ibexa-color-primary;
+ fill: var(--ibexa-hover-color);
}
}
}
@@ -330,7 +335,7 @@
&:hover {
#{$self}__content {
- border-color: $ibexa-color-dark;
+ border-color: var(--ibexa-border-color);
transform: scale(1.02) translateX(-10px);
box-shadow: calculateRem(4px) calculateRem(10px) calculateRem(17px) 0 rgba($ibexa-color-info, 0.2);
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_popup.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_popup.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_popup.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_popup.scss 2024-07-02 10:23:24.954906982 +0200
@@ -46,4 +46,8 @@
}
}
}
+
+ .ibexa-label--checkbox-radio {
+ padding-left: calculateRem(4px);
+ }
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_simple.dropdown.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_simple.dropdown.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_simple.dropdown.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_simple.dropdown.scss 2024-07-02 10:23:24.954906982 +0200
@@ -35,9 +35,12 @@
border-radius: $ibexa-border-radius;
box-shadow: calculateRem(4px) calculateRem(32px) calculateRem(47px) 0 rgba($ibexa-color-info, 0.1);
transition: opacity $ibexa-admin-transition-duration $ibexa-admin-transition;
- opacity: 0;
- height: 0;
- overflow: hidden;
+ transform: scaleX(1);
+
+ &--hidden {
+ transform: scaleX(0);
+ opacity: 0;
+ }
}
&__list-items {
@@ -114,11 +117,6 @@
}
}
- &--expanded .c-simple-dropdown__items {
- opacity: 1;
- height: auto;
- }
-
&--disabled {
opacity: 0.3;
cursor: not-allowed;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/thumbnail.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/thumbnail.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/thumbnail.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/thumbnail.scss 2024-07-02 10:23:24.956906987 +0200
@@ -1,5 +1,6 @@
.c-thumbnail {
position: relative;
+ line-height: 1;
&__icon-wrapper {
position: absolute;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_tooltip.popup.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_tooltip.popup.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_tooltip.popup.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_tooltip.popup.scss 2024-07-02 10:23:24.954906982 +0200
@@ -9,6 +9,12 @@
margin: 0;
}
+ &__subtitle {
+ @include modal-subtitle();
+
+ color: $ibexa-color-dark;
+ }
+
&__close {
@include close-button();
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_drop.area.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_drop.area.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_drop.area.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_drop.area.scss 2024-07-02 10:23:24.956906987 +0200
@@ -5,21 +5,81 @@
flex-direction: column;
justify-content: center;
align-items: center;
+ padding: calculateRem(47px);
&__message {
+ color: $ibexa-color-dark;
+ margin-bottom: calculateRem(16px);
+ }
+
+ &__message--main {
+ cursor: auto;
+ font-weight: 600;
+ }
+
+ &__message--filesize {
+ margin: calculateRem(16px) 0 0 0;
color: $ibexa-color-dark-400;
- margin-bottom: calculateRem(12px);
+ font-size: $ibexa-text-font-size-medium;
+ }
+
+ &__max-files-size {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ row-gap: calculateRem(8px);
+
+ &--expanded {
+ .c-drop-area {
+ &__max-file-size-item {
+ display: flex;
+ }
- &--main {
- cursor: auto;
- font-weight: bold;
- margin-top: calculateRem(44px);
+ &__max-file-size-toggle-btn {
+ &::after {
+ transform: rotate(-180deg);
+ }
+ }
+ }
}
+ }
+
+ &__max-file-size-item {
+ display: none;
+ gap: calculateRem(4px);
+ justify-content: center;
+ align-items: center;
+ font-size: $ibexa-text-font-size-small;
- &--filesize {
- color: $ibexa-color-dark-300;
+ &:first-child {
font-size: $ibexa-text-font-size-medium;
- margin: calculateRem(12px) 0 calculateRem(44px);
+ display: flex;
+ }
+ }
+
+ &__max-file-size-toggle-btn {
+ width: calculateRem(16px);
+ height: calculateRem(16px);
+ position: relative;
+ display: inline-block;
+ cursor: pointer;
+ border: none;
+
+ &::after {
+ content: '';
+ position: absolute;
+ width: calculateRem(6px);
+ height: calculateRem(3px);
+ top: calc(50% - calculateRem(3px));
+ right: 0;
+ border-left: calculateRem(6px) solid transparent;
+ border-right: calculateRem(6px) solid transparent;
+ border-top: calculateRem(6px) solid $ibexa-color-dark-400;
+ transition: all $ibexa-admin-transition-duration $ibexa-admin-transition;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_progress.bar.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_progress.bar.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_progress.bar.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_progress.bar.scss 2024-07-02 10:23:24.956906987 +0200
@@ -9,13 +9,13 @@
border-radius: calculateRem(4px);
transition: width 0.2s linear;
height: calculateRem(8px);
- width: 10vw;
+ width: calculateRem(176px);
position: relative;
&::after {
content: '';
width: calc(100% - var(--progress));
- height: calculateRem(10px);
+ height: calculateRem(11px);
border-radius: calculateRem(4px);
position: absolute;
right: 0;
@@ -29,7 +29,7 @@
}
&__label {
- font-size: $ibexa-text-font-size-small;
+ font-size: $ibexa-text-font-size-medium;
color: $ibexa-color-dark-400;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.item.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.item.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.item.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.item.scss 2024-07-02 10:23:24.956906987 +0200
@@ -1,20 +1,39 @@
.c-upload-list-item {
display: flex;
+ flex-wrap: wrap;
background: $ibexa-color-white;
- padding: calculateRem(8px) 0;
- min-height: calculateRem(60px);
+ padding: 0;
+ margin: calculateRem(12px) 0;
+ height: calculateRem(48px);
&--errored {
- background: $ibexa-color-danger-100;
- color: $ibexa-color-danger;
+ background: $ibexa-color-danger-200;
+ color: $ibexa-color-danger-600;
border-radius: $ibexa-border-radius;
.ibexa-icon {
- fill: $ibexa-color-danger;
+ fill: $ibexa-color-danger-600;
}
.c-upload-list-item__size {
- color: $ibexa-color-danger;
+ color: $ibexa-color-danger-600;
+ }
+ }
+
+ &--expanded-multiple-errors {
+ padding-bottom: 0;
+ height: auto;
+
+ .c-upload-list-item {
+ &__multiple-errors-list {
+ display: block;
+ padding: calculateRem(4px) 0 calculateRem(8px) calculateRem(26px);
+ margin-top: calculateRem(4px);
+ }
+
+ &__multiple-errors-toggle-btn {
+ transform: rotate(180deg);
+ }
}
}
@@ -26,26 +45,25 @@
}
&__meta {
- padding: 0 calculateRem(16px);
- line-height: 1.4;
+ padding: 0 calculateRem(8px);
max-width: 25vw;
+ height: calculateRem(48px);
display: flex;
justify-content: center;
align-items: center;
}
&__name {
- font-size: calculateRem(16px);
margin-right: calculateRem(8px);
- max-width: 15vw;
+ max-width: calculateRem(172px);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&__size {
- color: $ibexa-color-dark-300;
- font-size: $ibexa-text-font-size-medium;
+ color: $ibexa-color-dark-400;
+ font-size: $ibexa-text-font-size-small;
}
&__info {
@@ -56,8 +74,8 @@
}
&__message {
- font-style: italic;
- font-size: $ibexa-text-font-size-small;
+ font-size: $ibexa-text-font-size-medium;
+ line-height: $ibexa-text-font-size-medium;
.ibexa-icon {
margin-right: calculateRem(4px);
@@ -70,6 +88,14 @@
fill: $ibexa-color-success;
}
}
+
+ &--error {
+ display: flex;
+ align-items: center;
+ font-size: $ibexa-text-font-size-small;
+ line-height: $ibexa-text-font-size-small;
+ padding-right: calculateRem(32px);
+ }
}
&__actions {
@@ -93,4 +119,27 @@
margin-right: 0;
}
}
+
+ &__multiple-errors-toggle-btn {
+ border: none;
+ outline: none;
+ margin: 0 0 0 calculateRem(8px);
+ padding: 0;
+ transition: all $ibexa-admin-transition-duration $ibexa-admin-transition;
+ }
+
+ &__multiple-errors-list {
+ display: none;
+ flex-basis: 100%;
+ background: $ibexa-color-danger-100;
+ padding: 0;
+ margin: 0;
+ list-style: none;
+ border-radius: 0 0 $ibexa-border-radius $ibexa-border-radius;
+ }
+
+ &__multiple-errors-item {
+ margin: calculateRem(4px) 0;
+ font-size: $ibexa-text-font-size-medium;
+ }
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.list.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.list.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.list.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.list.scss 2024-07-02 10:23:24.956906987 +0200
@@ -1,14 +1,5 @@
.c-upload-list {
- &__items {
- margin-top: calculateRem(32px);
- padding: calculateRem(16px) 0;
-
- &:not(:empty) {
- border-top: calculateRem(1px) solid $ibexa-color-light-500;
- }
-
- &:last-child {
- padding-bottom: 0;
- }
- }
+ height: 100%;
+ overflow: auto;
+ margin-top: calculateRem(16px);
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.popup.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.popup.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.popup.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.popup.scss 2024-07-02 10:23:24.956906987 +0200
@@ -8,32 +8,54 @@
width: 100vw;
color: $ibexa-color-dark;
+ &__label {
+ margin-bottom: calculateRem(8px);
+ color: $ibexa-color-dark-400;
+ font-size: $ibexa-text-font-size-small;
+ line-height: calculateRem(18px);
+ }
+
.c-tooltip-popup {
width: 100%;
- max-width: calculateRem(774px);
+ max-height: 100vh;
+ max-width: calculateRem(800px);
position: absolute;
z-index: 2;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
- padding: 0 calculateRem(24px);
+ overflow: hidden;
&__header {
@include modal-header();
- padding: $modal-header-padding-y $modal-header-padding-x;
- border-bottom: $modal-header-border-width solid $modal-header-border-color;
+ height: calculateRem(92px);
+ padding: calculateRem(32px) calculateRem(32px) 0;
+ margin-bottom: calculateRem(36px);
+ }
+
+ &__title {
+ line-height: calculateRem(42px);
+ }
+
+ &__close {
+ top: 0;
+ }
+
+ &__subtitle {
+ margin-top: calculateRem(8px);
}
&__content {
@include modal-body();
- padding: $modal-inner-padding;
+ padding: 0 calculateRem(32px);
+ max-height: calc(100vh - calculateRem(208px));
+ overflow: auto;
}
- }
- .c-upload-list {
- overflow-y: auto;
- max-height: 30vw;
+ &__footer {
+ padding: calculateRem(16px) calculateRem(32px) calculateRem(32px) calculateRem(32px);
+ }
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss 2024-07-02 10:19:28.419331824 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss 2024-07-02 10:23:24.956906987 +0200
@@ -1,7 +1,6 @@
.c-finder-branch {
display: flex;
position: relative;
- padding: calculateRem(18px) 0 calculateRem(18px) calculateRem(8px);
border-right: calculateRem(1px) solid $ibexa-color-light;
&--collapsed {
@@ -53,7 +52,7 @@
&__items-wrapper {
overflow: auto;
width: calculateRem(291px);
- padding-right: calculateRem(8px);
+ padding: calculateRem(8px);
}
&__resize-handler {
@@ -70,6 +69,6 @@
display: flex;
align-items: center;
justify-content: center;
- margin-top: calculateRem(50px);
+ margin: calculateRem(50px) 0;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/forgot_password/mail.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/forgot_password/mail.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/forgot_password/mail.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/forgot_password/mail.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -10,7 +10,7 @@
{{ 'ezplatform.forgot_user_password.message'|trans({ '%reset_password%': url('ibexa.user.reset_password', {'hashKey': hash_key}) })|raw
|desc('Hi,
<br /><br />
- We have received a request to reset the password for your eZ Platform account. Click “reset password” below to choose a new password:
+ We have received a request to reset the password for your Ibexa DXP account. Click “reset password” below to choose a new password:
<br /><br />
<a href="%reset_password%">Reset password</a>
<br /><br />
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -10,6 +10,7 @@
attr: {
'data-notifications': path('ibexa.notifications.render.page'),
'data-notifications-count': path('ibexa.notifications.count'),
+ 'data-notifications-count-interval': notifications_count_interval,
'data-notifications-total': pager.nbResults,
}
} %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/components/meta_fields.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/components/meta_fields.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/components/meta_fields.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/components/meta_fields.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -1,6 +1,15 @@
{% extends '@ibexadesign/ui/component/anchor_navigation/section_group.html.twig' %}
+{% trans_default_domain 'ibexa_fields_groups' %}
+
{% set data_id = 'ibexa-edit-content-sections-meta' %}
+{% set is_section_visible = show_meta_fields|default(false) %}
+
+{% block header %}
+ {% if show_meta_fields_header|default(false) %}
+ <h2 class="ibexa-anchor-navigation__section-group-header">{{ 'metadata'|trans()|desc('Metadata') }}</h2>
+ {% endif %}
+{% endblock %}
{% block sections %}
{% for identifier in meta_fields %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -77,7 +77,9 @@
'content_type': content_type,
'location': location,
'parent_location': parent_location,
- 'language': language
+ 'language': language,
+ 'show_meta_fields': show_meta_fields|default(false),
+ 'show_meta_fields_header': show_meta_fields_header|default(false),
}) }}
{% endblock %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -140,6 +140,7 @@
'contentType': content_type,
'draft_pagination_params': draft_pagination_params,
'reverse_relation_pagination_params': reverse_relation_pagination_params,
+ 'relation_pagination_params': relation_pagination_params,
'custom_urls_pagination_params': custom_urls_pagination_params,
'system_urls_pagination_params': system_urls_pagination_params,
'roles_pagination_params': roles_pagination_params,
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/tab.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/tab.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/tab.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/tab.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -1,10 +1,24 @@
{% trans_default_domain 'ibexa_locationview' %}
<section>
- {{ include('@ibexadesign/content/tab/relations/table_relations.html.twig', {
- relations: relations,
- content: content,
- }) }}
+ {% if relation_pager is defined %}
+ {{ include('@ibexadesign/content/tab/relations/table_relations.html.twig', {
+ relations: relation_pager.currentPageResults,
+ content: content,
+ }) }}
+ {% if relation_pager.haveToPaginate %}
+ {% include '@ibexadesign/ui/pagination.html.twig' with {
+ 'pager': relation_pager,
+ 'paginaton_params': {
+ 'routeName': relation_pagination_params.route_name,
+ 'routeParams': relation_pagination_params.route_params|merge({
+ '_fragment': constant('Ibexa\\AdminUi\\Tab\\LocationView\\RelationsTab::URI_FRAGMENT'),
+ }),
+ 'pageParameter': '[page][relation]'
+ }
+ } %}
+ {% endif %}
+ {% endif %}
{% if reverse_relation_pager is defined %}
{{ include('@ibexadesign/content/tab/relations/table_relations_reverse.html.twig', {
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/table_relations.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/table_relations.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/table_relations.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/table_relations.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -6,36 +6,46 @@
{% if relations is not empty %}
{% for relation in relations %}
{% set body_row_cols = [] %}
- {% set destination = relation.destinationContentInfo %}
-
- {% set col_raw %}
- {% if destination.mainLocationId is not null %}
- <a href="{{ path('ibexa.content.view', { 'contentId': destination.id, 'locationId': relation.resolvedDestinationLocation.id }) }}">
+ {% if relation.isAccessible %}
+ {% set destination = relation.destinationContentInfo %}
+ {% set col_raw %}
+ {% if destination.mainLocationId is not null %}
+ <a href="{{ path('ibexa.content.view', { 'contentId': destination.id, 'locationId': relation.resolvedDestinationLocation.id }) }}">
+ {{ ibexa_content_name(destination) }}
+ </a>
+ {% else %}
{{ ibexa_content_name(destination) }}
- </a>
- {% else %}
- {{ ibexa_content_name(destination) }}
- {% endif %}
- {% endset %}
- {% set body_row_cols = body_row_cols|merge([{
- content: col_raw,
- raw: true,
- }]) %}
-
- {% set body_row_cols = body_row_cols|merge([
- { content: content_types[destination.contentTypeId].name },
- ]) %}
-
- {% set col_raw %}
- {{ macros.relation_type(relation) }}
- {% if (relation.relationFieldDefinitionName) %}
- ({{ relation.relationFieldDefinitionName }})
- {% endif %}
- {% endset %}
- {% set body_row_cols = body_row_cols|merge([{
- content: col_raw,
- raw: true,
- }]) %}
+ {% endif %}
+ {% endset %}
+ {% set body_row_cols = body_row_cols|merge([{
+ content: col_raw,
+ raw: true,
+ }]) %}
+
+ {% set body_row_cols = body_row_cols|merge([
+ { content: content_types[destination.contentTypeId].name },
+ ]) %}
+
+ {% set col_raw %}
+ {{ macros.relation_type(relation) }}
+ {% if (relation.relationFieldDefinitionName) %}
+ ({{ relation.relationFieldDefinitionName }})
+ {% endif %}
+ {% endset %}
+ {% set body_row_cols = body_row_cols|merge([{
+ content: col_raw,
+ raw: true,
+ }]) %}
+ {% else %}
+ {% set body_row_cols = body_row_cols|merge([{
+ attr: { colspan: 8 },
+ content: 'dashboard.table.relation.unauthorized'|trans({
+ '%module%': relation.unauthorizedRelation.module,
+ '%function%': relation.unauthorizedRelation.function,
+ '%contentId%': relation.unauthorizedRelation.payload.contentId,
+ })|desc('You do not have the \'%function%\' \'%module%\' permission for content ID: %contentId%'),
+ }]) %}
+ {% endif %}
{% set body_rows = body_rows|merge([{ cols: body_row_cols }]) %}
{% endfor %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -25,10 +25,17 @@
{{ form_widget(form.language, {'attr': {'class': 'form-control'}}) }}
{% endif %}
</div>
-
+
<div class="ibexa-extra-actions__section-content ibexa-extra-actions__section-content--content-type">
<div class="ibexa-instant-filter">
- <div class="ibexa-instant-filter__input-wrapper">
+ {% set minimum_items_count_for_search_to_appear = 10 %}
+ <div
+ class="
+ ibexa-instant-filter__input-wrapper
+ {% if form.content_type.children|length <= minimum_items_count_for_search_to_appear %}
+ ibexa-instant-filter__input-wrapper--hidden
+ {% endif %}"
+ >
<input
type="text"
class="ibexa-instant-filter__input ibexa-input ibexa-input--text form-control"
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/anchor_navigation/section_group.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/anchor_navigation/section_group.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/anchor_navigation/section_group.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/anchor_navigation/section_group.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -1,8 +1,10 @@
<div
- class="ibexa-anchor-navigation__section-group"
+ class="ibexa-anchor-navigation__section-group
+ {% if is_section_visible|default(false) %}ibexa-anchor-navigation__section-group--active{% endif %}"
data-id="#{{ data_id }}"
>
<div class="ibexa-anchor-navigation-sections">
+ {% block header %}{% endblock %}
{% block sections %}{% endblock %}
</div>
</div>
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/sub_items/multifile_upload.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/sub_items/multifile_upload.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/sub_items/multifile_upload.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/sub_items/multifile_upload.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -3,5 +3,6 @@
data-parent-location-path="{{ location.pathString }}"
data-parent-content-type-identifier="{{ contentType.identifier }}"
data-parent-content-type-id="{{ contentType.id }}"
+ data-parent-name="{{ location.contentInfo.name }}"
data-current-language="{{ app.request.get('languageCode') ?: content.prioritizedFieldLanguageCode }}"
></div>
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/tab/tabs_header.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/tab/tabs_header.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/tab/tabs_header.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/tab/tabs_header.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -3,8 +3,11 @@
{% set tabs_attr = tabs_attr|default({})|merge({
class: (tabs_attr.class|default('') ~ ' ibexa-tabs')|trim,
}) %}
+{% set header_attr = attr|default({})|merge({
+ class: (attr.class|default('') ~ ' ibexa-header')|trim,
+}) %}
-<div class="ibexa-header">
+<div {{ html.attributes(header_attr) }}>
<div {{ html.attributes(tabs_attr) }}>
<ul class="nav nav-tabs ibexa-tabs__list ibexa-adaptive-items" role="tablist">
{% block tabs_list %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -443,10 +443,12 @@
<td>{{ 'ezimage.master_dimensions'|trans|desc('Master dimensions') }}:</td>
<td>{{ 'ezimage.width_and_height'|trans({'%width%': field.value.width, '%height%': field.value.height})|desc('Width: %width%px height: %height%px') }}</td>
</tr>
- <tr class="ibexa-field-preview__meta-value-row">
- <td>{{ 'ezimage.ratio'|trans|desc('Ratio') }}:</td>
- <td>{{ (field.value.width/field.value.height)|round(2) }}</td>
- </tr>
+ {% if field.value.height != '0' %}
+ <tr class="ibexa-field-preview__meta-value-row">
+ <td>{{ 'ezimage.ratio'|trans|desc('Ratio') }}:</td>
+ <td>{{ (field.value.width/field.value.height)|round(2) }}</td>
+ </tr>
+ {% endif %}
</tbody>
</table>
</div>
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/menu/user.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/menu/user.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/menu/user.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/menu/user.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -15,6 +15,7 @@
</svg>
<span class="ibexa-header-user-menu__notice-dot ibexa-header-user-menu__notice-dot--no-notice"></span>
</div>
+ {{ ibexa_render_component_group('header-user-menu-middle') }}
<button class="ibexa-header-user-menu__toggler">
<div class="ibexa-header-user-menu__thumbnail-wrapper">
{% include '@ibexadesign/ui/component/user_thumbnail/user_thumbnail.html.twig' with {
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/search/spellcheck.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/search/spellcheck.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/search/spellcheck.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/search/spellcheck.html.twig 2024-07-02 10:23:24.958906992 +0200
@@ -2,11 +2,11 @@
{% if spellcheck is not null and spellcheck.incorrect %}
<div class="ibexa-search-form__spellcheck-suggestion">
- {% set suggestion_link %}
+ {%- set suggestion_link -%}
<a href="{{ path('ibexa.search', app.request.query|merge({'search[query]': spellcheck.query})) }}">
- {{ spellcheck.query }}
+ {{- spellcheck.query|spaceless -}}
</a>
- {% endset %}
+ {%- endset -%}
{{ 'search.spellcheck.suggestion'|trans|desc('Did you mean %s?')|e('html')|format(suggestion_link)|raw }}
</div>
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig 2024-07-02 10:23:24.958906992 +0200
@@ -34,9 +34,9 @@
id: user.content.versionInfo.contentInfo.id,
name: ibexa_content_name(user)
}) %}
- {% set items_map = form.users.vars.data|reduce((output, user) => output|merge({
- "{{user.content.versionInfo.contentInfo.id}}": user.id
- }), {}) %}
+ {% set items_map = form.users.vars.data|reduce((output, user) => output + {
+ (user.id): user.content.versionInfo.contentInfo.mainLocationId,
+ }, {}) %}
{% set users_udw_title = "role_assignment.view.add.panel.users_and_groups.users.udw_title"
|trans({}, 'ibexa_role')
|desc("Select Users to assign to the Role") %}
@@ -66,9 +66,9 @@
id: group.content.versionInfo.contentInfo.id,
name: ibexa_content_name(group.content)
}) %}
- {% set items_map = form.groups.vars.data|reduce((output, group) => output|merge({
- "{{group.content.versionInfo.contentInfo.i}}": group.id
- }), {}) %}
+ {% set items_map = form.groups.vars.data|reduce((output, group) => output + {
+ (group.id): group.content.versionInfo.contentInfo.mainLocationId,
+ }, {}) %}
{% set groups_udw_title = "role_assignment.view.add.panel.users_and_groups.groups.udw_title"
|trans({}, 'ibexa_role')
|desc("Select User Groups to assign to the Role") %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/contracts/Permission/PermissionCheckerInterface.php vendor-4.6.7/ibexa/admin-ui/src/contracts/Permission/PermissionCheckerInterface.php
--- vendor-4.6.2/ibexa/admin-ui/src/contracts/Permission/PermissionCheckerInterface.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/contracts/Permission/PermissionCheckerInterface.php 2024-07-02 10:23:24.959906995 +0200
@@ -41,7 +41,7 @@
* @deprecated 4.6.0 The "\Ibexa\Contracts\AdminUi\Permission\PermissionCheckerInterface::getContentUpdateLimitations()" method is deprecated, will be removed in 5.0.
* Use { @see \Ibexa\AdminUi\Permission\LimitationResolverInterface::getContentUpdateLimitations } instead.
*/
- public function getContentUpdateLimitations(Location $parentLocation): LookupLimitationResult;
+ public function getContentUpdateLimitations(Location $location): LookupLimitationResult;
}
class_alias(PermissionCheckerInterface::class, 'EzSystems\EzPlatformAdminUi\Permission\PermissionCheckerInterface');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Behat/Component/ContentTypePicker.php vendor-4.6.7/ibexa/admin-ui/src/lib/Behat/Component/ContentTypePicker.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Behat/Component/ContentTypePicker.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Behat/Component/ContentTypePicker.php 2024-07-02 10:23:24.960906997 +0200
@@ -17,6 +17,8 @@
{
private IbexaDropdown $ibexaDropdown;
+ public const MINIMUM_ITEMS_COUNT_FOR_SEARCH_INPUT = 10;
+
public function __construct(Session $session, IbexaDropdown $ibexaDropdown)
{
parent::__construct($session);
@@ -26,12 +28,21 @@
public function select(string $contentTypeName): void
{
$countBeforeFiltering = $this->getDisplayedItemsCount();
- $this->getHTMLPage()->find($this->getLocator('filterInput'))->setValue($contentTypeName);
- $this->getHTMLPage()->setTimeout(3)->waitUntil(function () use ($countBeforeFiltering) {
- return $countBeforeFiltering === 1 || $this->getDisplayedItemsCount() < $countBeforeFiltering;
- }, 'The number of displayed content types did not decrease after filtering.');
+ if ($countBeforeFiltering > self::MINIMUM_ITEMS_COUNT_FOR_SEARCH_INPUT) {
+ $this->getHTMLPage()->find($this->getLocator('filterInput'))->clear();
+ $this->getHTMLPage()->find($this->getLocator('filterInput'))->setValue($contentTypeName);
+ $this->getHTMLPage()->setTimeout(3)->waitUntil(function () use ($countBeforeFiltering) {
+ return $this->getDisplayedItemsCount() < $countBeforeFiltering;
+ }, 'The number of displayed content types did not decrease after filtering.');
+ }
+
+ $this->clickOnItem($contentTypeName);
+ }
+
+ public function clickOnItem(string $contentTypeName): void
+ {
$this->getHTMLPage()
- ->findAll($this->getLocator('filteredItem'))
+ ->findAll($this->getLocator('contentTypeItem'))
->getByCriterion(new ElementTextCriterion($contentTypeName))
->click();
}
@@ -44,13 +55,12 @@
protected function getDisplayedItemsCount(): int
{
- return $this->getHTMLPage()->findAll($this->getLocator('filteredItem'))->count();
+ return $this->getHTMLPage()->findAll($this->getLocator('contentTypeItem'))->count();
}
public function verifyIsLoaded(): void
{
$this->getHTMLPage()->setTimeout(3)->find($this->getLocator('header'))->assert()->textEquals('Create content');
- $this->getHTMLPage()->find($this->getLocator('filterInput'))->clear();
}
public function confirm(): void
@@ -62,7 +72,7 @@
{
return [
new VisibleCSSLocator('filterInput', '.ibexa-content-menu-wrapper .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__input, .c-udw-tab .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__input'),
- new VisibleCSSLocator('filteredItem', '.ibexa-content-menu-wrapper .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__group-item:not([hidden]) .form-check-label, .c-udw-tab .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__group-item:not([hidden]) .form-check-label'),
+ new VisibleCSSLocator('contentTypeItem', '.ibexa-content-menu-wrapper .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__group-item:not([hidden]) .form-check-label, .c-udw-tab .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__group-item:not([hidden]) .form-check-label'),
new VisibleCSSLocator('header', '.ibexa-content-menu-wrapper .ibexa-extra-actions--create .ibexa-extra-actions__header h2'),
new VisibleCSSLocator('languageDropdown', '.ibexa-content-menu-wrapper .ibexa-dropdown__selection-info'),
new VisibleCSSLocator('createButton', '.c-content-create__confirm-button, [id="content_create_create"]'),
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Behat/Page/AdminUpdateItemPage.php vendor-4.6.7/ibexa/admin-ui/src/lib/Behat/Page/AdminUpdateItemPage.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Behat/Page/AdminUpdateItemPage.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Behat/Page/AdminUpdateItemPage.php 2024-07-02 10:23:24.960906997 +0200
@@ -85,7 +85,7 @@
new VisibleCSSLocator('closeButton', '.ibexa-content-edit-container__close'),
new VisibleCSSLocator('button', '.container button'),
new VisibleCSSLocator('tab', '.ibexa-anchor-navigation-menu__sections-item'),
- new VisibleCSSLocator('fieldInput', 'input'),
+ new VisibleCSSLocator('fieldInput', 'input,textarea'),
];
}
@@ -94,6 +94,6 @@
return $this->getHTMLPage()
->findAll(new XPathLocator('input', '//label/..'))
->getByCriterion(new ChildElementTextCriterion(new VisibleCSSLocator('input', 'label'), $fieldName))
- ->find(new VisibleCSSLocator('input', 'input'));
+ ->find($this->getLocator('fieldInput'));
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Event/AddContentTypeGroupToUIConfigEvent.php vendor-4.6.7/ibexa/admin-ui/src/lib/Event/AddContentTypeGroupToUIConfigEvent.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Event/AddContentTypeGroupToUIConfigEvent.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Event/AddContentTypeGroupToUIConfigEvent.php 2024-07-02 10:23:24.960906997 +0200
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\AdminUi\Event;
+
+use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup;
+use Symfony\Contracts\EventDispatcher\Event;
+
+final class AddContentTypeGroupToUIConfigEvent extends Event
+{
+ /** @var array<\Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup> */
+ private array $contentTypeGroups;
+
+ /**
+ * @param array<\Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup> $contentTypeGroups
+ */
+ public function __construct(array $contentTypeGroups)
+ {
+ $this->contentTypeGroups = $contentTypeGroups;
+ }
+
+ /**
+ * @return array<\Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup>
+ */
+ public function getContentTypeGroups(): array
+ {
+ return $this->contentTypeGroups;
+ }
+
+ public function addContentTypeGroup(
+ ContentTypeGroup $contentTypeGroup
+ ): void {
+ $this->contentTypeGroups[] = $contentTypeGroup;
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/EventListener/InContextTranslationListener.php vendor-4.6.7/ibexa/admin-ui/src/lib/EventListener/InContextTranslationListener.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/EventListener/InContextTranslationListener.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/EventListener/InContextTranslationListener.php 2024-07-02 10:23:24.960906997 +0200
@@ -59,7 +59,7 @@
return;
}
- $inContextSetting = $this->userSettingService->getUserSetting('in_context_translation')->value;
+ $inContextSetting = $this->userSettingService->getUserSetting('in_context_translation')->getValue();
if ($inContextSetting !== InContextTranslation::ENABLED_OPTION) {
return;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Pagination/Pagerfanta/RelationAdapter.php vendor-4.6.7/ibexa/admin-ui/src/lib/Pagination/Pagerfanta/RelationAdapter.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Pagination/Pagerfanta/RelationAdapter.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Pagination/Pagerfanta/RelationAdapter.php 2024-07-02 10:23:24.960906997 +0200
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\AdminUi\Pagination\Pagerfanta;
+
+use Ibexa\AdminUi\UI\Dataset\DatasetFactory;
+use Ibexa\Contracts\Core\Repository\ContentService;
+use Ibexa\Contracts\Core\Repository\Values\Content\Content;
+use Pagerfanta\Adapter\AdapterInterface;
+
+final class RelationAdapter implements AdapterInterface
+{
+ private ContentService $contentService;
+
+ private DatasetFactory $datasetFactory;
+
+ private Content $content;
+
+ public function __construct(
+ ContentService $contentService,
+ DatasetFactory $datasetFactory,
+ Content $content
+ ) {
+ $this->contentService = $contentService;
+ $this->datasetFactory = $datasetFactory;
+ $this->content = $content;
+ }
+
+ public function getNbResults(): int
+ {
+ return $this->contentService->countRelations($this->content->getVersionInfo());
+ }
+
+ /**
+ * @return \Ibexa\AdminUi\UI\Value\Content\RelationInterface[]
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
+ */
+ public function getSlice($offset, $length): array
+ {
+ return $this->datasetFactory
+ ->relationList()
+ ->load($this->content, $offset, $length)
+ ->getRelations();
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Input/Parser/ContentTree/LoadSubtreeRequest.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Input/Parser/ContentTree/LoadSubtreeRequest.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Input/Parser/ContentTree/LoadSubtreeRequest.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Input/Parser/ContentTree/LoadSubtreeRequest.php 2024-07-02 10:23:24.960906997 +0200
@@ -9,14 +9,15 @@
namespace Ibexa\AdminUi\REST\Input\Parser\ContentTree;
use Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequest as LoadSubtreeRequestValue;
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
use Ibexa\Contracts\Rest\Exceptions;
use Ibexa\Contracts\Rest\Input\ParsingDispatcher;
-use Ibexa\Rest\Input\BaseParser;
+use Ibexa\Rest\Server\Input\Parser\Criterion as CriterionParser;
-class LoadSubtreeRequest extends BaseParser
+class LoadSubtreeRequest extends CriterionParser
{
/**
- * {@inheritdoc}
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
*/
public function parse(array $data, ParsingDispatcher $parsingDispatcher): LoadSubtreeRequestValue
{
@@ -31,7 +32,31 @@
$nodes[] = $parsingDispatcher->parse($node, $node['_media-type']);
}
- return new LoadSubtreeRequestValue($nodes);
+ $filter = null;
+ if (array_key_exists('Filter', $data) && is_array($data['Filter'])) {
+ $filter = $this->processCriteriaArray($data['Filter'], $parsingDispatcher);
+ }
+
+ return new LoadSubtreeRequestValue($nodes, $filter);
+ }
+
+ /**
+ * @param array<string, mixed> $criteriaArray
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
+ */
+ private function processCriteriaArray(array $criteriaArray, ParsingDispatcher $parsingDispatcher): ?Criterion
+ {
+ if (count($criteriaArray) === 0) {
+ return null;
+ }
+
+ $criteria = [];
+ foreach ($criteriaArray as $criterionName => $criterionData) {
+ $criteria[] = $this->dispatchCriterion($criterionName, $criterionData, $parsingDispatcher);
+ }
+
+ return (count($criteria) === 1) ? $criteria[0] : new Criterion\LogicalAnd($criteria);
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/NodeExtendedInfoVisitor.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/NodeExtendedInfoVisitor.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/NodeExtendedInfoVisitor.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/NodeExtendedInfoVisitor.php 2024-07-02 10:23:24.960906997 +0200
@@ -0,0 +1,88 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\AdminUi\REST\Output\ValueObjectVisitor\ContentTree;
+
+use Ibexa\Contracts\Rest\Output\Generator;
+use Ibexa\Contracts\Rest\Output\ValueObjectVisitor;
+use Ibexa\Contracts\Rest\Output\Visitor;
+use Symfony\Component\HttpFoundation\Response;
+
+/**
+ * @phpstan-import-type TPermissionRestrictions from \Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo
+ */
+final class NodeExtendedInfoVisitor extends ValueObjectVisitor
+{
+ public const MAIN_ELEMENT = 'ContentTreeNodeExtendedInfo';
+
+ /**
+ * @param \Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo $data
+ */
+ public function visit(Visitor $visitor, Generator $generator, $data): void
+ {
+ $generator->startObjectElement(self::MAIN_ELEMENT);
+ $visitor->setHeader('Content-Type', $generator->getMediaType(self::MAIN_ELEMENT));
+ $visitor->setStatus(Response::HTTP_OK);
+
+ $this->buildPermissionNode($data->getPermissionRestrictions(), $generator);
+ $this->buildPreviewableTranslationsNode($data->getPreviewableTranslations(), $generator);
+
+ $generator->endObjectElement(self::MAIN_ELEMENT);
+ }
+
+ /**
+ * @param string[] $previewableTranslations
+ */
+ protected function buildPreviewableTranslationsNode(
+ array $previewableTranslations,
+ Generator $generator
+ ): void {
+ $generator->startHashElement('previewableTranslations');
+ $generator->startList('values');
+ foreach ($previewableTranslations as $value) {
+ $generator->valueElement('value', $value);
+ }
+ $generator->endList('values');
+ $generator->endHashElement('previewableTranslations');
+ }
+
+ /**
+ * @phpstan-param TPermissionRestrictions $permissionRestrictions
+ */
+ protected function buildPermissionNode(
+ ?array $permissionRestrictions,
+ Generator $generator
+ ): void {
+ if (null === $permissionRestrictions) {
+ return;
+ }
+
+ $generator->startList('permissions');
+
+ foreach ($permissionRestrictions as $function => $restrictions) {
+ $generator->startHashElement('function');
+ $generator->attribute('name', $function);
+ foreach ($restrictions as $restrictionKey => $restrictionValue) {
+ if (is_array($restrictionValue)) {
+ $generator->startHashElement($restrictionKey . 'List');
+ $generator->startList($restrictionKey);
+ foreach ($restrictionValue as $value) {
+ $generator->valueElement('value', $value);
+ }
+ $generator->endList($restrictionKey);
+ $generator->endHashElement($restrictionKey . 'List');
+ } elseif (is_bool($restrictionValue)) {
+ $generator->valueElement($restrictionKey, $generator->serializeBool($restrictionValue));
+ }
+ }
+ $generator->endHashElement('function');
+ }
+
+ $generator->endList('permissions');
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php 2024-07-02 10:23:24.960906997 +0200
@@ -41,7 +41,7 @@
$generator->valueElement('translations', implode(',', $data->translations));
- $generator->valueElement('previewableTranslations', implode(',', $data->previewableTranslations));
+ $generator->valueElement('mainLanguageCode', $data->mainLanguageCode);
$generator->startValueElement('name', $data->name);
$generator->endValueElement('name');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/LoadSubtreeRequest.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/LoadSubtreeRequest.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/LoadSubtreeRequest.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/LoadSubtreeRequest.php 2024-07-02 10:23:24.960906997 +0200
@@ -8,19 +8,23 @@
namespace Ibexa\AdminUi\REST\Value\ContentTree;
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
use Ibexa\Rest\Value as RestValue;
class LoadSubtreeRequest extends RestValue
{
/** @var \Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequestNode[] */
- public $nodes;
+ public array $nodes;
+
+ public ?Criterion $filter;
/**
* @param array $nodes
*/
- public function __construct(array $nodes = [])
+ public function __construct(array $nodes = [], ?Criterion $filter = null)
{
$this->nodes = $nodes;
+ $this->filter = $filter;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/NodeExtendedInfo.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/NodeExtendedInfo.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/NodeExtendedInfo.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/NodeExtendedInfo.php 2024-07-02 10:23:24.960906997 +0200
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\AdminUi\REST\Value\ContentTree;
+
+use Ibexa\Rest\Value as RestValue;
+
+/**
+ * @phpstan-type TRestrictions array{
+ * hasAccess: bool,
+ * restrictedContentTypeIds?: array<int>,
+ * restrictedLanguageCodes?: array<string>,
+ * }
+ * @phpstan-type TPermissionRestrictions array{
+ * create: TRestrictions,
+ * edit: TRestrictions,
+ * delete: TRestrictions,
+ * hide: TRestrictions,
+ * }
+ */
+final class NodeExtendedInfo extends RestValue
+{
+ /** @phpstan-var TPermissionRestrictions|null */
+ private ?array $permissions;
+
+ /** @var string[] */
+ private array $previewableTranslations;
+
+ /**
+ * @phpstan-param TPermissionRestrictions|null $permissions
+ *
+ * @param string[] $previewableTranslation
+ */
+ public function __construct(
+ ?array $permissions = null,
+ array $previewableTranslation = []
+ ) {
+ $this->permissions = $permissions;
+ $this->previewableTranslations = $previewableTranslation;
+ }
+
+ /**
+ * @return TPermissionRestrictions|null
+ */
+ public function getPermissionRestrictions(): ?array
+ {
+ return $this->permissions;
+ }
+
+ /**
+ * @return string[]
+ */
+ public function getPreviewableTranslations(): array
+ {
+ return $this->previewableTranslations;
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/Node.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/Node.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/Node.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/Node.php 2024-07-02 10:23:24.960906997 +0200
@@ -26,9 +26,6 @@
/** @var string[] */
public array $translations;
- /** @var string[] */
- public array $previewableTranslations;
-
/** @var string */
public $name;
@@ -56,12 +53,13 @@
public string $pathString;
+ public string $mainLanguageCode;
+
/**
* @param int $depth
* @param int $locationId
* @param int $contentId
* @param string[] $translations
- * @param string[] $previewableTranslations
* @param string $name
* @param string $contentTypeIdentifier
* @param bool $isContainer
@@ -76,7 +74,6 @@
int $contentId,
int $versionNo,
array $translations,
- array $previewableTranslations,
string $name,
string $contentTypeIdentifier,
bool $isContainer,
@@ -85,6 +82,7 @@
int $totalChildrenCount,
int $reverseRelationsCount,
bool $isBookmarked,
+ string $mainLanguageCode,
array $children = [],
string $pathString = ''
) {
@@ -93,7 +91,6 @@
$this->contentId = $contentId;
$this->versionNo = $versionNo;
$this->translations = $translations;
- $this->previewableTranslations = $previewableTranslations;
$this->name = $name;
$this->isInvisible = $isInvisible;
$this->contentTypeIdentifier = $contentTypeIdentifier;
@@ -104,6 +101,7 @@
$this->isBookmarked = $isBookmarked;
$this->children = $children;
$this->pathString = $pathString;
+ $this->mainLanguageCode = $mainLanguageCode;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Siteaccess/AbstractSiteaccessPreviewVoter.php vendor-4.6.7/ibexa/admin-ui/src/lib/Siteaccess/AbstractSiteaccessPreviewVoter.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Siteaccess/AbstractSiteaccessPreviewVoter.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Siteaccess/AbstractSiteaccessPreviewVoter.php 2024-07-02 10:23:24.960906997 +0200
@@ -36,7 +36,7 @@
$location = $context->getLocation();
$languageCode = $context->getLanguageCode();
- if (empty(array_intersect($this->getRootLocationIds($siteAccess), $location->path))) {
+ if (empty(array_intersect($this->getRootLocationIds($siteAccess), $location->getPath()))) {
return false;
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Siteaccess/SiteaccessResolver.php vendor-4.6.7/ibexa/admin-ui/src/lib/Siteaccess/SiteaccessResolver.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Siteaccess/SiteaccessResolver.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Siteaccess/SiteaccessResolver.php 2024-07-02 10:23:24.960906997 +0200
@@ -81,7 +81,7 @@
): array {
$contentInfo = $location->getContentInfo();
$versionInfo = $this->contentService->loadVersionInfo($contentInfo, $versionNo);
- $languageCode = $languageCode ?? $contentInfo->mainLanguageCode;
+ $languageCode = $languageCode ?? $contentInfo->getMainLanguageCode();
$eligibleSiteAccesses = [];
/** @var \Ibexa\Core\MVC\Symfony\SiteAccess $siteAccess */
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Strategy/ContentTypeThumbnailStrategy.php vendor-4.6.7/ibexa/admin-ui/src/lib/Strategy/ContentTypeThumbnailStrategy.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Strategy/ContentTypeThumbnailStrategy.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Strategy/ContentTypeThumbnailStrategy.php 2024-07-02 10:23:24.960906997 +0200
@@ -34,7 +34,7 @@
?VersionInfo $versionInfo = null
): ?Thumbnail {
try {
- $contentTypeIcon = $this->contentTypeIconResolver->getContentTypeIcon($contentType->identifier);
+ $contentTypeIcon = $this->contentTypeIconResolver->getContentTypeIcon($contentType->getIdentifier());
return new Thumbnail([
'resource' => $contentTypeIcon,
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Tab/LocationView/RelationsTab.php vendor-4.6.7/ibexa/admin-ui/src/lib/Tab/LocationView/RelationsTab.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Tab/LocationView/RelationsTab.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Tab/LocationView/RelationsTab.php 2024-07-02 10:23:24.960906997 +0200
@@ -8,6 +8,7 @@
namespace Ibexa\AdminUi\Tab\LocationView;
+use Ibexa\AdminUi\Pagination\Pagerfanta\RelationAdapter;
use Ibexa\AdminUi\Pagination\Pagerfanta\ReverseRelationAdapter;
use Ibexa\AdminUi\UI\Dataset\DatasetFactory;
use Ibexa\Contracts\AdminUi\Tab\AbstractEventDispatchingTab;
@@ -130,21 +131,26 @@
));
$contentTypeIds = [];
-
- $relationListDataset = $this->datasetFactory->relationList();
- $relationListDataset->load($content);
- $relations = $relationListDataset->getRelations();
+ $relationPagination = new Pagerfanta(
+ new RelationAdapter($this->contentService, $this->datasetFactory, $content)
+ );
+ $relationPaginationParams = $contextParameters['relation_pagination_params'];
+ $relationPagination->setMaxPerPage($relationPaginationParams['limit']);
+ $relationPagination->setCurrentPage(min(
+ max($relationPaginationParams['page'], 1),
+ $relationPagination->getNbPages()
+ ));
$viewParameters = [];
-
+ $relations = $relationPagination->getCurrentPageResults();
foreach ($relations as $relation) {
if ($relation->isAccessible()) {
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Relation $relation */
$contentTypeIds[] = $relation->getDestinationContentInfo()->contentTypeId;
}
}
-
- $viewParameters['relations'] = $relations;
+ $viewParameters['relation_pager'] = $relationPagination;
+ $viewParameters['relation_pagination_params'] = $relationPaginationParams;
if ($this->permissionResolver->canUser('content', 'reverserelatedlist', $content)) {
$reverseRelations = $reverseRelationPagination->getCurrentPageResults();
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypeMappings.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypeMappings.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypeMappings.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypeMappings.php 2024-07-02 10:23:24.960906997 +0200
@@ -8,36 +8,41 @@
namespace Ibexa\AdminUi\UI\Config\Provider;
use Ibexa\Contracts\AdminUi\UI\Config\ProviderInterface;
+use Ibexa\Contracts\Core\Repository\ContentTypeService;
/**
* Class responsible for generating PlatformUI configuration for Multi File Upload functionality.
*/
class ContentTypeMappings implements ProviderInterface
{
- /** @var array */
- protected $locationMappings = [];
+ private ContentTypeService $contentTypeService;
- /** @var array */
- protected $defaultMappings = [];
+ /** @var array<string, mixed> */
+ protected array $locationMappings = [];
- /** @var array */
- protected $fallbackContentType = [];
+ /** @var array<string, mixed> */
+ protected array $defaultMappings = [];
- /** @var int */
+ /** @var array<string, mixed> */
+ protected array $fallbackContentType = [];
+
+ /** @var numeric */
protected $maxFileSize = 0;
/**
- * @param array $locationMappings
- * @param array $defaultMappings
- * @param array $fallbackContentType
- * @param int $maxFileSize
+ * @param array<string, mixed> $locationMappings
+ * @param array<string, mixed> $defaultMappings
+ * @param array<string, mixed> $fallbackContentType
+ * @param numeric $maxFileSize
*/
public function __construct(
+ ContentTypeService $contentTypeService,
array $locationMappings,
array $defaultMappings,
array $fallbackContentType,
$maxFileSize
) {
+ $this->contentTypeService = $contentTypeService;
$this->locationMappings = $locationMappings;
$this->defaultMappings = $defaultMappings;
$this->fallbackContentType = $fallbackContentType;
@@ -45,9 +50,9 @@
}
/**
- * Returns configuration structure compatible with PlatformUI.
+ * Returns configuration structure compatible with AdminUI.
*
- * @return array
+ * @return array<string, mixed>
*/
public function getConfig(): array
{
@@ -78,33 +83,73 @@
}
/**
- * @param array $mappingGroup
+ * @param array<string> $mappingGroup
*
- * @return array
+ * @return array<string, mixed>
*/
- private function buildMappingGroupStructure(array $mappingGroup)
+ private function buildMappingGroupStructure(array $mappingGroup): array
{
+ $contentTypeIdentifier = $mappingGroup['content_type_identifier'];
+ $contentFieldIdentifier = $mappingGroup['content_field_identifier'];
+
return [
'mimeTypes' => $mappingGroup['mime_types'],
- 'contentTypeIdentifier' => $mappingGroup['content_type_identifier'],
- 'contentFieldIdentifier' => $mappingGroup['content_field_identifier'],
+ 'contentTypeIdentifier' => $contentTypeIdentifier,
+ 'contentFieldIdentifier' => $contentFieldIdentifier,
'nameFieldIdentifier' => $mappingGroup['name_field_identifier'],
+ 'maxFileSize' => $this->getContentTypeConfiguredMaxFileSize(
+ $contentTypeIdentifier,
+ $contentFieldIdentifier
+ ),
];
}
/**
- * @param array $fallbackContentType
+ * @param array<string> $fallbackContentType
*
- * @return array
+ * @return array<string, mixed>
*/
- private function buildFallbackContentTypeStructure(array $fallbackContentType)
+ private function buildFallbackContentTypeStructure(array $fallbackContentType): array
{
+ $fallbackContentTypeIdentifier = $fallbackContentType['content_type_identifier'];
+ $fallbackContentFieldIdentifier = $fallbackContentType['content_field_identifier'];
+
return [
'contentTypeIdentifier' => $fallbackContentType['content_type_identifier'],
'contentFieldIdentifier' => $fallbackContentType['content_field_identifier'],
'nameFieldIdentifier' => $fallbackContentType['name_field_identifier'],
+ 'maxFileSize' => $this->getContentTypeConfiguredMaxFileSize(
+ $fallbackContentTypeIdentifier,
+ $fallbackContentFieldIdentifier
+ ),
];
}
+
+ /**
+ * @return numeric
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function getContentTypeConfiguredMaxFileSize(
+ string $contentTypeIdentifier,
+ string $imageFieldTypeIdentifier
+ ) {
+ $contentType = $this->contentTypeService->loadContentTypeByIdentifier(
+ $contentTypeIdentifier
+ );
+
+ $imgFieldType = $contentType->getFieldDefinition($imageFieldTypeIdentifier);
+ if ($imgFieldType === null) {
+ return $this->maxFileSize;
+ }
+
+ $validatorConfig = $imgFieldType->getValidatorConfiguration();
+ if (isset($validatorConfig['FileSizeValidator']['maxFileSize'])) {
+ return $validatorConfig['FileSizeValidator']['maxFileSize'] * 1024 * 1024;
+ }
+
+ return $this->maxFileSize;
+ }
}
class_alias(ContentTypeMappings::class, 'EzSystems\EzPlatformAdminUi\UI\Config\Provider\ContentTypeMappings');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypes.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypes.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypes.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypes.php 2024-07-02 10:23:24.960906997 +0200
@@ -7,6 +7,7 @@
namespace Ibexa\AdminUi\UI\Config\Provider;
+use Ibexa\AdminUi\Event\AddContentTypeGroupToUIConfigEvent;
use Ibexa\AdminUi\Event\FilterContentTypesEvent;
use Ibexa\AdminUi\UI\Service\ContentTypeIconResolver;
use Ibexa\Contracts\AdminUi\UI\Config\ProviderInterface;
@@ -24,6 +25,7 @@
* isContainer: bool,
* thumbnail: string,
* href: string,
+ * isHidden: bool,
* }
*/
class ContentTypes implements ProviderInterface
@@ -73,7 +75,16 @@
$loadedContentTypeGroups = $this->contentTypeService->loadContentTypeGroups(
$preferredLanguages
);
+
+ $eventContentTypeGroups = [];
foreach ($loadedContentTypeGroups as $contentTypeGroup) {
+ $eventContentTypeGroups[] = $contentTypeGroup;
+ }
+
+ /** @var \Ibexa\AdminUi\Event\AddContentTypeGroupToUIConfigEvent $event */
+ $event = $this->eventDispatcher->dispatch(new AddContentTypeGroupToUIConfigEvent($eventContentTypeGroups));
+
+ foreach ($event->getContentTypeGroups() as $contentTypeGroup) {
$contentTypes = $this->contentTypeService->loadContentTypes(
$contentTypeGroup,
$preferredLanguages
@@ -84,7 +95,10 @@
});
foreach ($contentTypes as $contentType) {
- $contentTypeGroups[$contentTypeGroup->identifier][] = $this->getContentTypeData($contentType);
+ $contentTypeGroups[$contentTypeGroup->identifier][] = $this->getContentTypeData(
+ $contentType,
+ $contentTypeGroup->isSystem,
+ );
}
}
@@ -97,7 +111,7 @@
/**
* @phpstan-return TContentTypeData
*/
- private function getContentTypeData(ContentType $contentType): array
+ private function getContentTypeData(ContentType $contentType, bool $isHidden): array
{
return [
'id' => $contentType->id,
@@ -108,6 +122,7 @@
'href' => $this->urlGenerator->generate('ibexa.rest.load_content_type', [
'contentTypeId' => $contentType->id,
]),
+ 'isHidden' => $isHidden,
];
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/Module/DamWidget.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/Module/DamWidget.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/Module/DamWidget.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/Module/DamWidget.php 2024-07-02 10:23:24.961907000 +0200
@@ -11,52 +11,150 @@
use Ibexa\Bundle\Core\ApiLoader\Exception\InvalidSearchEngine;
use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider;
use Ibexa\Contracts\AdminUi\UI\Config\ProviderInterface;
+use Ibexa\Contracts\Core\Repository\ContentTypeService;
+use Ibexa\Contracts\Core\Repository\NameSchema\SchemaIdentifierExtractorInterface;
+use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType;
/**
- * @template TConfig of array{
+ * @phpstan-type TConfig array{
* image: array{
- * fieldDefinitionIdentifiers: array<string>,
- * contentTypeIdentifiers: array<string>,
* aggregations: array<string, array<string, string>>,
+ * mappings: array<
+ * string,
+ * array{
+ * imageFieldIdentifier: string
+ * },
+ * >,
+ * },
+ * folder: array{
+ * contentTypeIdentifier: string,
* }
- * }
+ * }
+ * @phpstan-type TImageConfig array{
+ * fieldDefinitionIdentifiers: array<string>,
+ * contentTypeIdentifiers: array<string>,
+ * aggregations: array<string, array<string, string>>,
+ * showImageFilters: bool,
+ * enableMultipleDownload: bool,
+ * mappings: array<
+ * string,
+ * array{
+ * imageFieldIdentifier: string,
+ * nameSchemaIdentifiers: array<string>,
+ * }
+ * >,
+ * }
+ * @phpstan-type TFolderConfig array{
+ * contentTypeIdentifier: string,
+ * nameSchemaIdentifiers: array<string>
+ * }
*/
final class DamWidget implements ProviderInterface
{
/** @phpstan-var TConfig */
private array $config;
+ private ContentTypeService $contentTypeService;
+
private RepositoryConfigurationProvider $repositoryConfigurationProvider;
+ private SchemaIdentifierExtractorInterface $schemaIdentifierExtractor;
+
/**
* @phpstan-param TConfig $config
*/
public function __construct(
array $config,
- RepositoryConfigurationProvider $repositoryConfigurationProvider
+ ContentTypeService $contentTypeService,
+ RepositoryConfigurationProvider $repositoryConfigurationProvider,
+ SchemaIdentifierExtractorInterface $schemaIdentifierExtractor
) {
$this->config = $config;
+ $this->contentTypeService = $contentTypeService;
$this->repositoryConfigurationProvider = $repositoryConfigurationProvider;
+ $this->schemaIdentifierExtractor = $schemaIdentifierExtractor;
}
/**
* @phpstan-return array{
- * image: array{
- * fieldDefinitionIdentifiers: array<string>,
- * contentTypeIdentifiers: array<string>,
- * aggregations: array<string, array<string, string>>,
- * showImageFilters: bool,
- * }
+ * image: TImageConfig,
+ * folder: TFolderConfig
* }
*
- * @throws \Ibexa\Bundle\Core\ApiLoader\Exception\InvalidSearchEngine
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function getConfig(): array
{
- $widgetConfig = $this->config;
- $widgetConfig['image']['showImageFilters'] = $this->showImageFilters();
+ return [
+ 'image' => $this->getImageConfig(),
+ 'folder' => $this->getFolderConfig(),
+ ];
+ }
- return $widgetConfig;
+ /**
+ * @phpstan-return TImageConfig
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function getImageConfig(): array
+ {
+ $imageConfig = [
+ 'showImageFilters' => $this->showImageFilters(),
+ 'aggregations' => $this->config['image']['aggregations'],
+ 'enableMultipleDownload' => extension_loaded('zip'),
+ ];
+
+ $mappings = [];
+ $contentTypeIdentifiers = [];
+ $fieldDefinitionIdentifiers = [];
+
+ foreach ($this->config['image']['mappings'] as $contentTypeIdentifier => $mapping) {
+ $contentTypeIdentifiers[] = $contentTypeIdentifier;
+ $fieldDefinitionIdentifiers[] = $mapping['imageFieldIdentifier'];
+ $mappings[$contentTypeIdentifier] = $mapping;
+
+ $contentType = $this->loadContentType($contentTypeIdentifier);
+ $mappings[$contentTypeIdentifier]['nameSchemaIdentifiers'] = $this->extractNameSchemaIdentifiers($contentType);
+ }
+
+ $imageConfig['mappings'] = $mappings;
+ $imageConfig['contentTypeIdentifiers'] = $contentTypeIdentifiers;
+ $imageConfig['fieldDefinitionIdentifiers'] = $fieldDefinitionIdentifiers;
+
+ return $imageConfig;
+ }
+
+ /**
+ * @phpstan-return TFolderConfig
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function getFolderConfig(): array
+ {
+ $contentTypeIdentifier = $this->config['folder']['contentTypeIdentifier'];
+
+ return [
+ 'contentTypeIdentifier' => $contentTypeIdentifier,
+ 'nameSchemaIdentifiers' => $this->extractNameSchemaIdentifiers(
+ $this->loadContentType($contentTypeIdentifier)
+ ),
+ ];
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function loadContentType(string $contentTypeIdentifier): ContentType
+ {
+ return $this->contentTypeService->loadContentTypeByIdentifier($contentTypeIdentifier);
+ }
+
+ /**
+ * @return array<string>
+ */
+ private function extractNameSchemaIdentifiers(ContentType $contentType): array
+ {
+ return $this->schemaIdentifierExtractor->extract($contentType->nameSchema)['field'] ?? [];
}
/**
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Dataset/RelationListDataset.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Dataset/RelationListDataset.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Dataset/RelationListDataset.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Dataset/RelationListDataset.php 2024-07-02 10:23:24.961907000 +0200
@@ -11,7 +11,7 @@
use Ibexa\AdminUi\UI\Value\ValueFactory;
use Ibexa\Contracts\Core\Repository\ContentService;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
-use Ibexa\Contracts\Core\Repository\Values\Content\Relation;
+use Ibexa\Contracts\Core\Repository\Values\Content\RelationList\RelationListItemInterface;
final class RelationListDataset
{
@@ -43,15 +43,29 @@
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
public function load(
- Content $content
+ Content $content,
+ int $offset = 0,
+ int $limit = 10
): self {
$versionInfo = $content->getVersionInfo();
+ $relationListItems = $this->contentService->loadRelationList($versionInfo, $offset, $limit)->items;
$this->relations = array_map(
- function (Relation $relation) use ($content) {
- return $this->valueFactory->createRelation($relation, $content);
+ function (RelationListItemInterface $relationListItem) use ($content) {
+ if ($relationListItem->hasRelation()) {
+ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\RelationList\Item\RelationListItem $relationListItem */
+ return $this->valueFactory->createRelationItem(
+ $relationListItem,
+ $content
+ );
+ }
+
+ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\RelationList\Item\UnauthorizedRelationListItem $relationListItem */
+ return $this->valueFactory->createUnauthorizedRelationItem(
+ $relationListItem
+ );
},
- $this->contentService->loadRelations($versionInfo)
+ $relationListItems
);
return $this;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Module/ContentTree/NodeFactory.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Module/ContentTree/NodeFactory.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Module/ContentTree/NodeFactory.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Module/ContentTree/NodeFactory.php 2024-07-02 10:23:24.961907000 +0200
@@ -10,7 +10,6 @@
use Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequestNode;
use Ibexa\AdminUi\REST\Value\ContentTree\Node;
-use Ibexa\AdminUi\Siteaccess\SiteaccessResolverInterface;
use Ibexa\Contracts\Core\Repository\BookmarkService;
use Ibexa\Contracts\Core\Repository\ContentService;
use Ibexa\Contracts\Core\Repository\Exceptions\NotImplementedException;
@@ -36,6 +35,10 @@
final class NodeFactory
{
private const TOP_NODE_CONTENT_ID = 0;
+
+ /**
+ * @var array<string, class-string<\Ibexa\Contracts\Core\Repository\Values\Filter\FilteringSortClause>>
+ */
private const SORT_CLAUSE_MAP = [
'DatePublished' => SortClause\DatePublished::class,
'ContentName' => SortClause\ContentName::class,
@@ -59,8 +62,6 @@
private Repository $repository;
- private SiteaccessResolverInterface $siteaccessResolver;
-
/** @var int */
private $maxLocationIdsInSingleAggregation;
@@ -72,7 +73,6 @@
ConfigResolverInterface $configResolver,
PermissionResolver $permissionResolver,
Repository $repository,
- SiteaccessResolverInterface $siteaccessResolver,
int $maxLocationIdsInSingleAggregation
) {
$this->bookmarkService = $bookmarkService;
@@ -82,7 +82,6 @@
$this->configResolver = $configResolver;
$this->permissionResolver = $permissionResolver;
$this->repository = $repository;
- $this->siteaccessResolver = $siteaccessResolver;
$this->maxLocationIdsInSingleAggregation = $maxLocationIdsInSingleAggregation;
}
@@ -97,7 +96,8 @@
bool $loadChildren = false,
int $depth = 0,
?string $sortClause = null,
- string $sortOrder = Query::SORT_ASC
+ string $sortOrder = Query::SORT_ASC,
+ ?Criterion $requestFilter = null
): Node {
$uninitializedContentInfoList = [];
$containerLocations = [];
@@ -114,17 +114,18 @@
$depth,
$sortClause,
$sortOrder,
- $bookmarkedLocations
+ $bookmarkedLocations,
+ $requestFilter
);
$versionInfoById = $this->contentService->loadVersionInfoListByContentInfo($uninitializedContentInfoList);
$aggregatedChildrenCount = null;
if ($this->searchService->supports(SearchService::CAPABILITY_AGGREGATIONS)) {
- $aggregatedChildrenCount = $this->countAggregatedSubitems($containerLocations);
+ $aggregatedChildrenCount = $this->countAggregatedSubitems($containerLocations, $requestFilter);
}
$this->supplyTranslatedContentName($node, $versionInfoById);
- $this->supplyChildrenCount($node, $aggregatedChildrenCount);
+ $this->supplyChildrenCount($node, $aggregatedChildrenCount, $requestFilter);
return $node;
}
@@ -149,9 +150,10 @@
int $limit = 10,
int $offset = 0,
?string $sortClause = null,
- string $sortOrder = Query::SORT_ASC
+ string $sortOrder = Query::SORT_ASC,
+ ?Criterion $requestFilter = null
): SearchResult {
- $searchQuery = $this->getSearchQuery($parentLocation->id);
+ $searchQuery = $this->getSearchQuery($parentLocation->getId(), $requestFilter);
$searchQuery->limit = $limit;
$searchQuery->offset = $offset;
@@ -163,7 +165,7 @@
/**
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Location $parentLocation
*/
- private function getSearchQuery(int $parentLocationId): LocationQuery
+ private function getSearchQuery(int $parentLocationId, ?Criterion $requestFilter = null): LocationQuery
{
$searchQuery = new LocationQuery();
$searchQuery->filter = new Criterion\ParentLocationId($parentLocationId);
@@ -174,7 +176,7 @@
$contentTypeCriterion = new Criterion\ContentTypeIdentifier($this->getSetting('allowed_content_types'));
}
- if (empty($this->allowedContentTypes) && !empty($this->getSetting('ignored_content_types'))) {
+ if (!empty($this->getSetting('ignored_content_types'))) {
$contentTypeCriterion = new Criterion\LogicalNot(
new Criterion\ContentTypeIdentifier($this->getSetting('ignored_content_types'))
);
@@ -184,6 +186,10 @@
$searchQuery->filter = new Criterion\LogicalAnd([$searchQuery->filter, $contentTypeCriterion]);
}
+ if (null !== $requestFilter) {
+ $searchQuery->filter = new Criterion\LogicalAnd([$searchQuery->filter, $requestFilter]);
+ }
+
return $searchQuery;
}
@@ -201,9 +207,9 @@
/**
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
*/
- private function countSubitems(int $parentLocationId): int
+ private function countSubitems(int $parentLocationId, ?Criterion $requestFilter = null): int
{
- $searchQuery = $this->getSearchQuery($parentLocationId);
+ $searchQuery = $this->getSearchQuery($parentLocationId, $requestFilter);
$searchQuery->limit = 0;
$searchQuery->offset = 0;
@@ -214,8 +220,11 @@
/**
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Location[] $containerLocations
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
*/
- private function countAggregatedSubitems(array $containerLocations): array
+ private function countAggregatedSubitems(array $containerLocations, ?Criterion $requestFilter): array
{
if (empty($containerLocations)) {
return [];
@@ -226,7 +235,7 @@
$result = [];
foreach ($containerLocationsChunks as $containerLocationsChunk) {
- $result = array_replace($result, $this->countAggregatedSubitems($containerLocationsChunk));
+ $result = array_replace($result, $this->countAggregatedSubitems($containerLocationsChunk, $requestFilter));
}
return $result;
@@ -240,6 +249,10 @@
$locationChildrenTermAggregation->setLimit(\count($parentLocationIds));
$searchQuery->aggregations[] = $locationChildrenTermAggregation;
+ if (null !== $requestFilter) {
+ $searchQuery->filter = new Criterion\LogicalAnd([$searchQuery->filter, $requestFilter]);
+ }
+
$result = $this->searchService->findLocations($searchQuery);
if ($result->aggregations->has('childrens')) {
@@ -325,20 +338,21 @@
int $depth = 0,
?string $sortClause = null,
string $sortOrder = Query::SORT_ASC,
- array $bookmarkLocations = []
+ array $bookmarkLocations = [],
+ ?Criterion $requestFilter = null
): Node {
$contentInfo = $location->getContentInfo();
- $contentId = $location->contentId;
+ $contentId = $location->getContentId();
if (!isset($uninitializedContentInfoList[$contentId])) {
$uninitializedContentInfoList[$contentId] = $contentInfo;
}
// Top Level Location (id = 1) does not have a content type
- $contentType = $location->depth > 0
+ $contentType = $location->getDepth() > 0
? $contentInfo->getContentType()
: null;
- if ($contentType !== null && $contentType->isContainer) {
+ if ($contentType !== null && $contentType->isContainer()) {
$containerLocations[] = $location;
}
@@ -353,13 +367,13 @@
$totalChildrenCount = 0;
$children = [];
if ($loadChildren && $depth < $this->getSetting('tree_max_depth')) {
- $searchResult = $this->findSubitems($location, $limit, $offset, $sortClause, $sortOrder);
+ $searchResult = $this->findSubitems($location, $limit, $offset, $sortClause, $sortOrder, $requestFilter);
$totalChildrenCount = (int) $searchResult->totalCount;
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $childLocation */
foreach (array_column($searchResult->searchHits, 'valueObject') as $childLocation) {
$childLoadSubtreeRequestNode = null !== $loadSubtreeRequestNode
- ? $this->findChild($childLocation->id, $loadSubtreeRequestNode)
+ ? $this->findChild($childLocation->getId(), $loadSubtreeRequestNode)
: null;
$children[] = $this->buildNode(
@@ -371,32 +385,30 @@
$depth + 1,
null,
Query::SORT_ASC,
- $bookmarkLocations
+ $bookmarkLocations,
+ $requestFilter
);
}
}
- $translations = $versionInfo->languageCodes;
- $previewableTranslations = array_filter(
- $translations,
- fn (string $languageCode): bool => $this->isPreviewable($location, $content, $languageCode)
- );
+ $translations = $versionInfo->getLanguageCodes();
+ $mainLanguageCode = $versionInfo->getContentInfo()->getMainLanguageCode();
return new Node(
$depth,
- $location->id,
- $location->contentId,
- $versionInfo->versionNo,
+ $location->getId(),
+ $location->getContentId(),
+ $versionInfo->getVersionNo(),
$translations,
- $previewableTranslations,
'', // node name will be provided later by `supplyTranslatedContentName` method
- $contentType ? $contentType->identifier : '',
- $contentType ? $contentType->isContainer : true,
- $location->invisible || $location->hidden,
+ null !== $contentType ? $contentType->getIdentifier() : '',
+ null === $contentType || $contentType->isContainer(),
+ $location->isInvisible() || $location->isHidden(),
$limit,
$totalChildrenCount,
$this->getReverseRelationsCount($contentInfo),
- isset($bookmarkLocations[$location->id]),
+ isset($bookmarkLocations[$location->getId()]),
+ $mainLanguageCode,
$children,
$location->getPathString()
);
@@ -429,49 +441,25 @@
/**
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
*/
- private function supplyChildrenCount(Node $node, ?array $aggregationResult = null): void
- {
+ private function supplyChildrenCount(
+ Node $node,
+ ?array $aggregationResult = null,
+ ?Criterion $requestFilter = null
+ ): void {
if ($node->isContainer) {
if ($aggregationResult !== null) {
$totalCount = $aggregationResult[$node->locationId] ?? 0;
} else {
- $totalCount = $this->countSubitems($node->locationId);
+ $totalCount = $this->countSubitems($node->locationId, $requestFilter);
}
$node->totalChildrenCount = $totalCount;
}
foreach ($node->children as $child) {
- $this->supplyChildrenCount($child, $aggregationResult);
+ $this->supplyChildrenCount($child, $aggregationResult, $requestFilter);
}
}
-
- /**
- * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
- * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
- */
- private function isPreviewable(
- Location $location,
- Content $content,
- string $languageCode
- ): bool {
- $versionNo = $content->getVersionInfo()->versionNo;
-
- $siteAccesses = $this->siteaccessResolver->getSiteAccessesListForLocation(
- $location,
- $versionNo,
- $languageCode
- );
-
- $canPreview = $this->permissionResolver->canUser(
- 'content',
- 'versionread',
- $content,
- [$location]
- );
-
- return $canPreview && !empty($siteAccesses);
- }
}
class_alias(NodeFactory::class, 'EzSystems\EzPlatformAdminUi\UI\Module\ContentTree\NodeFactory');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Module/Subitems/ContentViewParameterSupplier.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Module/Subitems/ContentViewParameterSupplier.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Module/Subitems/ContentViewParameterSupplier.php 2024-07-02 10:19:28.426331841 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Module/Subitems/ContentViewParameterSupplier.php 2024-07-02 10:23:24.961907000 +0200
@@ -16,11 +16,13 @@
use Ibexa\Contracts\Core\Repository\ContentTypeService;
use Ibexa\Contracts\Core\Repository\LocationService;
use Ibexa\Contracts\Core\Repository\PermissionResolver;
+use Ibexa\Contracts\Core\Repository\SearchService;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\Location;
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType;
use Ibexa\Contracts\Rest\Output\Visitor;
use Ibexa\Core\MVC\Symfony\View\ContentView;
+use Ibexa\Core\Query\QueryFactoryInterface;
use Ibexa\Rest\Output\Generator\Json as JsonOutputGenerator;
use Ibexa\Rest\Server\Output\ValueObjectVisitor\ContentTypeInfoList as ContentTypeInfoListValueObjectVisitor;
use Ibexa\Rest\Server\Values\ContentTypeInfoList;
@@ -63,18 +65,10 @@
/** @var \I