Skip to content

Commit

Permalink
IBX-7333: Applied code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwojs committed Dec 13, 2023
1 parent ff97606 commit 5f39694
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 20 deletions.
9 changes: 5 additions & 4 deletions src/bundle/Controller/User/ProfileEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Ibexa\Contracts\Core\Repository\Repository;
use Ibexa\Contracts\Core\Repository\UserService;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Contracts\Core\Repository\Values\Content\Location;
use Ibexa\Contracts\Core\Repository\Values\User\User;
use Ibexa\Core\Base\Exceptions\UnauthorizedException as CoreUnauthorizedException;
use Symfony\Component\Form\Form;
Expand Down Expand Up @@ -104,11 +105,11 @@ public function editAction(Request $request, ?string $languageCode)
}
}

$location = $this->repository->sudo(function () use ($user) {
return $this->locationService->loadLocation(
$location = $this->repository->sudo(
fn (): Location => $this->locationService->loadLocation(
(int)$user->versionInfo->contentInfo->mainLocationId
);
});
)
);

$parentLocation = null;
try {
Expand Down
2 changes: 0 additions & 2 deletions src/bundle/Resources/config/services/user_profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ services:
decorates: Ibexa\Core\Helper\FieldsGroups\FieldsGroupsList
arguments:
$innerService: '@.inner'


6 changes: 3 additions & 3 deletions src/bundle/Resources/public/scss/_user-profile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
border-radius: 50%;

&--img {
width: 220px;
height: 220px;
width: calculateRem(220px);
height: calculateRem(220px);
}
}
}
Expand All @@ -41,7 +41,7 @@
}

&__aside {
width: 590px;
width: calculateRem(590px);
margin-right: calculateRem(20px);

.ibexa-user-profile-summary {
Expand Down
5 changes: 0 additions & 5 deletions src/bundle/Resources/translations/ibexa_admin_ui.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
<target state="new">Select language</target>
<note>key: edit_translation.list.title</note>
</trans-unit>
<trans-unit id="773756d8360258c56797a597252082a335b25e2c" resname="profile.view.title">
<source>User profile</source>
<target state="new">User profile</target>
<note>key: profile.view.title</note>
</trans-unit>
<trans-unit id="e4b8188e898e654dae14fc6b18133958f8e56084" resname="translation.remove.success">
<source>Removed '%languageCode%' translation from '%name%'.</source>
<target state="new">Removed '%languageCode%' translation from '%name%'.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% block breadcrumbs %}
{% include '@ibexadesign/ui/breadcrumbs.html.twig' with { items: [
{ value: 'profile.view.title'|trans|desc('User profile') }
{ value: 'user_profile.view.title'|trans|desc('User profile') }
]} %}
{% endblock %}

Expand Down
3 changes: 2 additions & 1 deletion src/bundle/ui-dev/src/modules/common/user-name/user.name.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ const { Routing, ibexa } = window;

const isUserProfileEnabled = (contentType) => {
const config = ibexa.adminUiConfig.userProfile;

if (config.enabled) {
return config.contentType.contains(contentType);
return config.contentTypes.includes(contentType);
}

return false;
Expand Down
3 changes: 0 additions & 3 deletions src/lib/Menu/UserMenuBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ public function createStructure(array $options): ItemInterface
return $menu;
}

/**
* @return \JMS\TranslationBundle\Model\Message[]
*/
public static function getTranslationMessages(): array
{
return [
Expand Down
2 changes: 1 addition & 1 deletion src/lib/UI/Config/Provider/UserProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getConfig(): array
{
return [
'enabled' => $this->configuration->isEnabled(),
'content_types' => $this->configuration->getContentTypes(),
'contentTypes' => $this->configuration->getContentTypes(),
];
}
}

0 comments on commit 5f39694

Please sign in to comment.