Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 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
@sonarcloud
Copy link

sonarcloud bot commented Sep 20, 2023

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

@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
10 checks passed
@webhdx webhdx deleted the ibx-6602-thumbnails-imprv branch September 29, 2023 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants