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-29621: Excluding Hidden content types from the Widgets displayed #30517

Merged
merged 8 commits into from
Dec 26, 2024

Conversation

Neehakethi
Copy link
Contributor

@Neehakethi Neehakethi commented Oct 30, 2024

This pull request introduces several changes to the DotPaletteStore and related test files to enhance the handling of content types and widgets, including the filtering of hidden content types. The most important changes include adding the DotPropertiesService for configuration management and refactoring the content type loading logic.

Enhancements to DotPaletteStore:

  • Added DotPropertiesService to manage configuration settings and retrieve hidden content types (CONTENT_PALETTE_HIDDEN_CONTENT_TYPES). ([[1]](https://github.com/dotCMS/core/pull/30517/files#diff-8262303c46e34e159efdc68dec99a47ddf453302794be94483b1abee94c13556R9), [[2]](https://github.com/dotCMS/core/pull/30517/files#diff-5e9e57d14e6a9185a0988e2062be4028f862924c1b068ac9eddab73da058e94fR13-R20), [[3]](https://github.com/dotCMS/core/pull/30517/files#diff-5e9e57d14e6a9185a0988e2062be4028f862924c1b068ac9eddab73da058e94fL166-R169))
  • Refactored the getContenttypesData method to use forkJoin with multiple observables, including hidden content types, and improved the filtering logic to exclude hidden content types. ([core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/components/dot-palette/store/dot-palette.store.tsL252-L282](https://github.com/dotCMS/core/pull/30517/files#diff-5e9e57d14e6a9185a0988e2062be4028f862924c1b068ac9eddab73da058e94fL252-L282))

Updates to tests:

  • Updated test cases to include DotPropertiesService and verify the filtering of hidden content types in dot-palette.store.spec.ts and edit-ema-palette.store.spec.ts. ([[1]](https://github.com/dotCMS/core/pull/30517/files#diff-8262303c46e34e159efdc68dec99a47ddf453302794be94483b1abee94c13556R114-R136), [[2]](https://github.com/dotCMS/core/pull/30517/files#diff-8262303c46e34e159efdc68dec99a47ddf453302794be94483b1abee94c13556R147), [[3]](https://github.com/dotCMS/core/pull/30517/files#diff-8262303c46e34e159efdc68dec99a47ddf453302794be94483b1abee94c13556L185-R233), [[4]](https://github.com/dotCMS/core/pull/30517/files#diff-1440c725f71c6ba67d7a4847e983e63b1e7a3a4fe17042aafe9553a89ad19f22L46-R82), [[5]](https://github.com/dotCMS/core/pull/30517/files#diff-1440c725f71c6ba67d7a4847e983e63b1e7a3a4fe17042aafe9553a89ad19f22R119-R131), [[6]](https://github.com/dotCMS/core/pull/30517/files#diff-1440c725f71c6ba67d7a4847e983e63b1e7a3a4fe17042aafe9553a89ad19f22R141-R160))

Refactoring:

  • Replaced inline sorting and filtering logic with pre-defined constants and helper methods to improve code readability and maintainability. ([[1]](https://github.com/dotCMS/core/pull/30517/files#diff-8262303c46e34e159efdc68dec99a47ddf453302794be94483b1abee94c13556R114-R136), [[2]](https://github.com/dotCMS/core/pull/30517/files#diff-8262303c46e34e159efdc68dec99a47ddf453302794be94483b1abee94c13556L185-R233), [[3]](https://github.com/dotCMS/core/pull/30517/files#diff-e60190c318aa61ddbc495b1c20398bb42e7baa8429b8241aa6964267f3ddd445L235-L259))

These changes improve the overall functionality and maintainability of the DotPaletteStore by incorporating configuration management and enhancing the content type filtering logic.

Video

issue-29621-Hide-Forms-from-Palette-1.mov

This PR fixes: #29621

@Neehakethi Neehakethi self-assigned this Oct 30, 2024
@Neehakethi Neehakethi linked an issue Oct 30, 2024 that may be closed by this pull request
@spbolton spbolton changed the title issue-29621: Excluding Hidden content types from the Widgets displaye… fix(relationships): Add extra logging when failure to parse jsonWithRelationships Oct 31, 2024
@spbolton spbolton changed the title fix(relationships): Add extra logging when failure to parse jsonWithRelationships issue-29621: Excluding Hidden content types from the Widgets displayed Oct 31, 2024
@Neehakethi Neehakethi force-pushed the issue-29621-Hide-Forms-from-Palette branch from 8477a3a to 0a85a98 Compare October 31, 2024 18:05
Copy link
Member

@fmontes fmontes left a comment

Choose a reason for hiding this comment

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

Approved, but need docs and needs unit tests.

@zJaaal
Copy link
Contributor

zJaaal commented Dec 9, 2024

The code LGTM but we need a unit test to merge it

Copy link
Contributor

@rjvelazco rjvelazco left a comment

Choose a reason for hiding this comment

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

@erickgonzalez is this still needed it?

@rjvelazco rjvelazco self-assigned this Dec 26, 2024
@rjvelazco rjvelazco enabled auto-merge December 26, 2024 17:15
@rjvelazco rjvelazco added this pull request to the merge queue Dec 26, 2024
auto-merge was automatically disabled December 26, 2024 18:16

Pull Request is not mergeable

Merged via the queue into main with commit 4b4b2da Dec 26, 2024
22 checks passed
@rjvelazco rjvelazco deleted the issue-29621-Hide-Forms-from-Palette branch December 26, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Be able to hide "Forms" from the Content tab in Edit mode.
8 participants