Skip to content
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

IBX-6602: Used Content::getThumbnail directly for obtaining thumbnails #56

Merged
merged 4 commits into from
Sep 29, 2023

Conversation

ViniTou
Copy link
Contributor

@ViniTou ViniTou commented Sep 19, 2023

https://issues.ibexa.co/browse/IBX-6602

Dropped ContentThumbnail resolver usage

There is no need for it, as thumbnails can be obtained directly from Content::getThumbnail or User::getThumbnail.
Done this way, instead of doing user.getContent(), as accessing content from user object is deprecated.

Fixed UserItem (and UserGroupItem)

As it had type: "UserItem" but it was resolved to value it was not UserItem, but actual User object.

Added Thumbnail for user object

As it is possible now, to obtain thumbnails by accessing content on user object like this:

{
  content {
    folder(contentId: 81) {
      _contentInfo {
        owner {
          id
          content {
            _thumbnail {
              uri
            }
          }
        }
      }
    }
  }
}

accessing content on user is deprecated (since 6,10 ;) ), so new property was added to match php API

{
  content {
     folder (contentId: 81) {
       id,
      _contentInfo {
        owner{
          thumbnail {
            uri,
          },
        }
      }
     }
  }
}

Fixed unpacking object to array:

resolve: "@=resolver('ContentTypesFromGroup', {'groupId': value.id})"

This was just not working, and can be tested with

{
_repository {
    contentTypes {
      groups {
        contentTypes {
          name
        }
      }
    }
  }
}  

@ViniTou ViniTou requested a review from a team September 19, 2023 16:09
@ViniTou ViniTou force-pushed the ibx-6602-thumbnails-imprv branch from 21d1e95 to 07f69fc Compare September 19, 2023 16:12
@ViniTou ViniTou force-pushed the ibx-6602-thumbnails-imprv branch from 07f69fc to 2a66c5a Compare September 19, 2023 16:19
@ViniTou ViniTou mentioned this pull request Sep 19, 2023
composer.json Outdated Show resolved Hide resolved
src/bundle/Resources/config/graphql/ContentType.types.yaml Outdated Show resolved Hide resolved
src/bundle/Resources/config/graphql/Item.types.yaml Outdated Show resolved Hide resolved
src/bundle/Resources/config/graphql/User.types.yaml Outdated Show resolved Hide resolved
src/bundle/Resources/config/graphql/User.types.yaml Outdated Show resolved Hide resolved
src/bundle/Resources/config/graphql/User.types.yaml Outdated Show resolved Hide resolved
src/lib/Resolver/ThumbnailResolver.php Show resolved Hide resolved
@konradoboza konradoboza requested a review from a team September 20, 2023 07:23
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ViniTou ViniTou requested a review from konradoboza September 20, 2023 08:34
@konradoboza konradoboza requested a review from a team September 20, 2023 08:44
Copy link

@tomaszszopinski tomaszszopinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA approved on IbexaDXP 4.5 commerce.

@bdunogier
Copy link
Collaborator

Looks good to me. Great PR description 10/10 :)

@webhdx webhdx merged commit 5aaf673 into 4.5 Sep 29, 2023
@webhdx webhdx deleted the ibx-6602-thumbnails-imprv branch September 29, 2023 10:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants