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

feat: add preventParentPostCascadeQuery option to control visibility of child category posts #6083

Merged
merged 7 commits into from
Jun 21, 2024

Conversation

guqing
Copy link
Member

@guqing guqing commented Jun 14, 2024

What type of PR is this?

/kind feature
/area core
/milestone 2.17.x

What this PR does / why we need it:

此次变更为文章分类引入了一个新的 preventParentPostCascadeQuery 布尔属性,用于控制分类及其子分类下的文章显示方式。具体变更包括:

  • 在分类结构中增加了 preventParentPostCascadeQuery 属性。
  • 当分类的 preventParentPostCascadeQuery 属性设置为 true 时,该分类的文章数量不会汇总到父分类中。
  • 更新了树结构遍历逻辑,以支持对 preventParentPostCascadeQuery 属性的处理。
  • 确保独立分类中的文章显示受控,不向上级分类进行聚合。
  • 增加了相应的测试用例,以验证在不同树结构中 preventParentPostCascadeQuery 属性的功能性。

Which issue(s) this PR fixes:

Fixes #5663
Fixes #4923
Fixes #3418

Does this PR introduce a user-facing change?

新增独立分类选项用于控制关联的子分类下的文章显示以提供更灵活的内容管理方式

@f2c-ci-robot f2c-ci-robot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 14, 2024
@f2c-ci-robot f2c-ci-robot bot added this to the 2.17.x milestone Jun 14, 2024
@f2c-ci-robot f2c-ci-robot bot requested a review from LIlGG June 14, 2024 09:56
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Jun 14, 2024
@f2c-ci-robot f2c-ci-robot bot requested a review from wan92hen June 14, 2024 09:56
@f2c-ci-robot f2c-ci-robot bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Jun 14, 2024
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 44 lines in your changes missing coverage. Please review.

Project coverage is 56.40%. Comparing base (5fdf6c0) to head (7f25830).
Report is 243 commits behind head on main.

Files Patch % Lines
...ava/run/halo/app/content/impl/PostServiceImpl.java 5.55% 17 Missing ⚠️
...un/halo/app/theme/finders/impl/PostFinderImpl.java 0.00% 13 Missing ⚠️
...run/halo/app/content/impl/CategoryServiceImpl.java 10.00% 9 Missing ⚠️
.../src/main/java/run/halo/app/content/PostQuery.java 75.00% 2 Missing ⚠️
...alo/app/theme/finders/impl/CategoryFinderImpl.java 91.66% 1 Missing and 1 partial ⚠️
.../run/halo/app/core/extension/content/Category.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6083      +/-   ##
============================================
- Coverage     56.91%   56.40%   -0.51%     
- Complexity     3319     3563     +244     
============================================
  Files           587      626      +39     
  Lines         18968    21089    +2121     
  Branches       1401     1493      +92     
============================================
+ Hits          10795    11896    +1101     
- Misses         7594     8588     +994     
- Partials        579      605      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 17, 2024
@guqing
Copy link
Member Author

guqing commented Jun 17, 2024

Hi @ruibaby 帮忙修改一下 UI: 分类列表需要为独立分类添加一个图标标识便于识别例如 link-break,文章列表需要修改分类查询的参数为 categoryWithChildren 且将分类的显示方式改为树状

Copy link

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

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

See analysis details on SonarCloud

@ruibaby ruibaby marked this pull request as ready for review June 19, 2024 10:21
@f2c-ci-robot f2c-ci-robot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 19, 2024
@f2c-ci-robot f2c-ci-robot bot requested review from JohnNiang and ruibaby June 19, 2024 10:21
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Jun 19, 2024
@guqing guqing changed the title feat: add independent option to control visibility of child category posts feat: add preventParentPostCascadeQuery option to control visibility of child category posts Jun 20, 2024
@f2c-ci-robot f2c-ci-robot bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lgtm Indicates that a PR is ready to be merged. labels Jun 20, 2024
@f2c-ci-robot f2c-ci-robot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2024
@guqing
Copy link
Member Author

guqing commented Jun 21, 2024

/ping @halo-dev/sig-halo

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Jun 21, 2024
Copy link

f2c-ci-robot bot commented Jun 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 21, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit 8bdde31 into halo-dev:main Jun 21, 2024
7 checks passed
@guqing guqing deleted the feature/5663 branch June 21, 2024 04:22
@ruibaby ruibaby modified the milestones: 2.17.x, 2.17.0 Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
3 participants