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-2667: Added Content Type Meta anchor menu #558

Merged
merged 62 commits into from
Oct 3, 2022

Conversation

ciastektk
Copy link
Contributor

@ciastektk ciastektk commented Aug 30, 2022

Question Answer
Tickets https://issues.ibexa.co/browse/IBX-2667
Bug fix? no
New feature? no
BC breaks? no
Tests pass? yes
Doc needed? yes
License GPL-2.0

Related to:
https://github.com/ibexa/seo/pull/5
https://github.com/ibexa/seo/pull/6
https://github.com/ibexa/seo/pull/11

This PR adds modifications to Field Types management in Content Type create / edit. Field Types which provides more complex functionality like SEO, Taxonomy, should be separated from Field definitions section. Field Types marked as meta Field Type will be presented in anchor menu as regular menu item. Configuration form is rendered below Field definitions section. Meta Field Types contains dynamically added enabled field to configure if Field Type will be used in Content Type or not. Enabling Field Type behave similar to dragging and dropping regular Field Type. Apart of the visual changes, rest of functionally is not changed.

Below configurations allows to configure meta fieldtype for content type:

ibexa:
    system:
        admin_group:
            admin_ui_forms:
                content_type_edit:
                    field_types:
                        ibexa_seo: 	# fieldtype identifier
                            meta: true 	# separate this fieldtype from Field definition section, put it in anchor menu and add enabled field
                            position: 100  # display meta field type on proper position in menu and content  

To use meta Field Types from anchor menu, meta field definitions must be added to ContentTypeDraft or ContentTypeCreateStruct before form will be rendered. ContentTypeController::addMetaFieldDefinitions is responsible to do that. In create action new meta field definitions are created for all configured meta Field Types. In edit action new meta field definitions are created for all configured and not enabled meta Field Types. Field Definitions for enabled Field Types are taken from database.

Before ContentType will be updated meta Field Definitions for all not enabled Field Types are removed.

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

@ciastektk ciastektk force-pushed the ibx-2667-added-content-type-edit-tabs branch 4 times, most recently from ef63333 to db532fb Compare August 31, 2022 09:34
Copy link
Contributor

@webhdx webhdx left a comment

Choose a reason for hiding this comment

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

I see ContentTypeEditAnchorMenuBuilder is made after #526 but this menu has different structure according to the mockups. It has to be fixed once the frontend part is done.

src/bundle/Controller/ContentTypeController.php Outdated Show resolved Hide resolved
src/bundle/Controller/ContentTypeController.php Outdated Show resolved Hide resolved
src/bundle/Controller/ContentTypeController.php Outdated Show resolved Hide resolved
src/bundle/Controller/ContentTypeController.php Outdated Show resolved Hide resolved
@ciastektk ciastektk changed the title IBX-2667: Added content type edit tabs IBX-2667: Added Content Type Meta anchor menu Sep 1, 2022
@ciastektk ciastektk force-pushed the ibx-2667-added-content-type-edit-tabs branch from 5b50365 to 220c41e Compare September 1, 2022 07:07
@ciastektk ciastektk marked this pull request as ready for review September 2, 2022 06:48
@ciastektk ciastektk requested review from webhdx and a team September 2, 2022 07:56
src/bundle/Controller/ContentTypeController.php Outdated Show resolved Hide resolved
src/bundle/Controller/ContentTypeController.php Outdated Show resolved Hide resolved
src/lib/Form/Data/FieldDefinitionData.php Outdated Show resolved Hide resolved
@ViniTou ViniTou requested a review from a team September 2, 2022 09:24
@konradoboza konradoboza requested a review from a team September 15, 2022 09:57
@ciastektk ciastektk force-pushed the ibx-2667-added-content-type-edit-tabs branch 2 times, most recently from b02f117 to dfa78e0 Compare September 15, 2022 11:04
@juskora juskora added the Doc needed The changes require some documentation label Sep 15, 2022
@ciastektk ciastektk requested a review from a team September 16, 2022 08:53
@ciastektk ciastektk changed the base branch from main to 4.2 September 20, 2022 07:44
Copy link
Member

@alongosz alongosz left a comment

Choose a reason for hiding this comment

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

I feel like whether a Field Definition is meta or not should belong to Core API, not Admin UI. However probably coming a bit too late to the party, so here are the remarks for the current solution:

@GrabowskiM GrabowskiM force-pushed the ibx-2667-added-content-type-edit-tabs branch from 57d7090 to 0643008 Compare September 21, 2022 10:52
@ciastektk ciastektk force-pushed the ibx-2667-added-content-type-edit-tabs branch from 060a5bd to c1737ea Compare September 28, 2022 05:45
@sonarcloud
Copy link

sonarcloud bot commented Sep 28, 2022

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 4 Code Smells

No Coverage information No Coverage information
2.4% 2.4% Duplication

Copy link
Contributor

@micszo micszo 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 4.2.2-dev.

Tested with all editions.

@micszo micszo removed their assignment Oct 3, 2022
@ciastektk ciastektk merged commit 0136b6e into 4.2 Oct 3, 2022
@ciastektk ciastektk deleted the ibx-2667-added-content-type-edit-tabs branch October 3, 2022 14:09
@dabrt dabrt removed the Doc needed The changes require some documentation label Oct 28, 2022
@juskora juskora added the Doc needed The changes require some documentation label Feb 21, 2023
@dabrt dabrt removed the Doc needed The changes require some documentation label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.