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

Issue #3476285: Improve usability of Taxonomy term creations #4139

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vcsvinicius
Copy link
Contributor

@vcsvinicius vcsvinicius commented Oct 28, 2024

Problem (for internal)

Currently we have several taxonomy vocabularies and we display default options to SM.
Some of them are not relevant and should be hidden.

Solution (for internal)

The fields are hidden using configuration, but don't config-modify or update-helper because some taxonomies doesn't have entity-form-display created.

So I created a logic to create entity-form-display when it doesn't exist or update when it already be created.

Release notes (to customers)

Improved the user-experience to create taxonomy-terms, some unnecessary fields was hide.

Issue tracker

PROD-30250
#3476285

Theme issue tracker

N/A

How to test

  • Enable Social Content Report, Social Event Type, Social Event, Social Group Flexible, Social Profile Fields, Social Profile Organization Tag and Social Profile modules
  • Access the which taxonimies mentioned below and check the fields as listed before

Taxonomies list:

  • Content tags:
    -- URL field visible

  • Profile tag
    -- URL field is not visible

  • Event type:
    -- URL field is not visible

  • Report reason
    -- URL field is not visible

  • Topic type
    -- URL field is not visible

  • Nationality
    -- URL field is not visible

  • Interest
    -- URL field is not visible

  • Group type
    -- URL field is not visible

  • Expertise
    -- URL field is not visible

  • Organization
    -- URL field is not visible

Change Record

N/A

Translations

N/A

@vcsvinicius vcsvinicius added type: feature Adds a new feature to Open Social status: needs review This pull request is waiting for a requested review prio: medium team: guardians labels Oct 28, 2024
@vcsvinicius vcsvinicius added this to the 13.0.0-alpha17 milestone Oct 28, 2024
@vcsvinicius vcsvinicius requested a review from a team October 28, 2024 13:26
Some taxonomies doesn't have entity-form-display created, so a logic is created to check it, after this validation the entity-form-display is created or updated.
@vcsvinicius vcsvinicius force-pushed the issue/3476285/rework-path-field-from-taxonomies branch from a74b63e to e6f62ad Compare October 28, 2024 13:47
/**
* Create entity-form-display or hidden path field from Profile Tag taxonomy.
*/
function social_profile_update_130003(): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

function social_profile_update_130003 and social_profile_update_130004 and social_profile_update_130005 are very duplicated code to me.
Can we create a service to use instead of copy pasting?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally social_content_report_update_130002 would be using the service as well if social_profile and social_content_report share a module dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created a function to avoid duplicate hook-update with same code, but I done only for Social Profile, because create a Service would complex because in Cablecar isn't be possible to use before a release.

These hook-update will be deleted in a near future, but let me know if you have other idea.

/**
* Create entity-form-display or hide path field from Organization Tag taxonomy.
*/
function social_profile_organization_tag_update_130002(): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why this update needs to be done using update hook and not form_alter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Acceptance Criteria is asking to change using configuration, because that way can reverted easily by other system if necessary.

@vcsvinicius vcsvinicius force-pushed the issue/3476285/rework-path-field-from-taxonomies branch from c174318 to ef7ddc8 Compare November 7, 2024 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio: medium status: needs review This pull request is waiting for a requested review team: guardians type: feature Adds a new feature to Open Social
Development

Successfully merging this pull request may close these issues.

2 participants