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-8089: Added configuration for image management #1236

Conversation

ciastektk
Copy link
Contributor

@ciastektk ciastektk commented Apr 9, 2024

🎫 Issue IBX-8089

Description:

This PR adds new configuration for image management allows to provide complex settings for different content types. In next steps we should be able to configure description and tags fields.

  • contentTypeIdentifiers and fieldDefinitionIdentifiers - now will be dynamically added, based on mappings parameter. Used in search criteria.

  • nameSchemaIdentifiers - same as for folder, name identifiers will be dynamically added as array of extracted field definition identifiers from nameSchema pattern.

Basic configuration:

    ibexa.dam_widget.image.mappings:
        <content_type_identifier>:
            imageFieldIdentifier: <field_definition_identifier>

Full response example

REST

            "image": {
                "showImageFilters": false,
                "aggregations": {
                    "KeywordTermAggregation": {
                        "name": "keywords",
                        "contentTypeIdentifier": "image",
                        "fieldDefinitionIdentifier": "tags"
                    }
                },
                "mappings": {
                    "image": {
                        "imageFieldIdentifier": "image",
                        "nameSchemaIdentifiers": [
                            "name"
                        ]
                    }
                },
                "contentTypeIdentifiers": [
                    "image"
                ],
                "fieldDefinitionIdentifiers": [
                    "image"
                ]
            }

Console

Screenshot 2024-04-09 at 13 53 37

For QA:

Documentation:

@ciastektk ciastektk marked this pull request as ready for review April 9, 2024 11:35
@ciastektk ciastektk requested a review from a team April 9, 2024 11:35
@ciastektk ciastektk added Improvement Ready for review Doc needed The changes require some documentation labels Apr 9, 2024
Copy link
Contributor

@Steveb-p Steveb-p left a comment

Choose a reason for hiding this comment

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

I have slight concerns about assumptions we're making about configuration data shape, but I believe we are doing things like that in different Providers as well.

Personally, I think we should rely on configuration data shape less, and be more verbose when it does not match / throw exceptions.

tests/lib/UI/Config/Provider/Module/DamWidgetTest.php Outdated Show resolved Hide resolved
tests/lib/UI/Config/Provider/Module/DamWidgetTest.php Outdated Show resolved Hide resolved
tests/lib/UI/Config/Provider/Module/DamWidgetTest.php Outdated Show resolved Hide resolved
@Steveb-p Steveb-p requested a review from a team April 11, 2024 08:48
@konradoboza konradoboza requested a review from a team April 11, 2024 13:19
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ciastektk ciastektk merged commit 6f63b50 into ibx-7981-improved-folder-configuration Apr 17, 2024
22 checks passed
@ciastektk ciastektk deleted the ibx-8089-added-configuration-for-image-management branch April 17, 2024 07:19
ciastektk added a commit that referenced this pull request Apr 17, 2024
* Improved folder configuration

* [Tests] Adjusted DamWidgetTest

* IBX-8089: Added configuration for image management (#1236)

* Added image mappings parameter

* Adjusted DamWidget

* [Tests] Adjusted DamWidgetTest

* [PHPStan] Added improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Doc needed The changes require some documentation Improvement QA approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants