-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
EZP-31767: Use version contributor name on dashboard #1437
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,16 +9,16 @@ | |
namespace EzSystems\EzPlatformAdminUi\Pagination\Mapper; | ||
|
||
use eZ\Publish\API\Repository\ContentTypeService; | ||
use eZ\Publish\API\Repository\Exceptions\NotFoundException; | ||
use eZ\Publish\API\Repository\LanguageService; | ||
use eZ\Publish\API\Repository\UserService; | ||
use eZ\Publish\API\Repository\Values\Content\Content; | ||
use eZ\Publish\API\Repository\Values\Content\ContentInfo; | ||
use eZ\Publish\API\Repository\Values\Content\Language; | ||
use eZ\Publish\API\Repository\Values\Content\VersionInfo; | ||
use eZ\Publish\API\Repository\Values\User\User; | ||
use eZ\Publish\Core\Helper\TranslationHelper; | ||
use eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface; | ||
use EzSystems\EzPlatformAdminUi\Specification\ContentIsUser; | ||
use EzSystems\EzPlatformAdminUi\Specification\UserExists; | ||
|
||
abstract class AbstractPagerContentToDataMapper | ||
{ | ||
|
@@ -88,19 +88,17 @@ protected function isContentIsUser(Content $content): bool | |
} | ||
|
||
/** | ||
* @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo | ||
* @param \eZ\Publish\API\Repository\Values\Content\VersionInfo $versionInfo | ||
* | ||
* @return \eZ\Publish\API\Repository\Values\User\User|null | ||
*/ | ||
protected function getContributor(ContentInfo $contentInfo): ?User | ||
protected function getVersionContributor(VersionInfo $versionInfo): ?User | ||
{ | ||
$userExists = (new UserExists($this->userService))->isSatisfiedBy($contentInfo->ownerId); | ||
|
||
if (false === $userExists) { | ||
try { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason why you did not reuse There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ViniTou This method called for each row, so this will save us a few Let me know if these few extra calls are not a big deal and I'll change it to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, I didnt notice the last removed call, fine with me then. |
||
return $this->userService->loadUser($versionInfo->creatorId); | ||
} catch (NotFoundException $e) { | ||
return null; | ||
} | ||
|
||
return $this->userService->loadUser($contentInfo->ownerId); | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if renaming protected function in abstract class is the safest way to do, it should be internal but maybe someone else have opinion on that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I create a separate
getVersionContributor
method, and keepgetContributor
as is? And, markgetContributor
with@deprecated
?