Skip to content

feat(Home Page): Admin news on home#2324

Merged
hirokiterashima merged 20 commits into
developfrom
admin-news-on-home
Jun 30, 2026
Merged

feat(Home Page): Admin news on home#2324
hirokiterashima merged 20 commits into
developfrom
admin-news-on-home

Conversation

@Aaron-Detre

Copy link
Copy Markdown
Contributor

Changes

  • When Discourse is not set in application properties, the home page should show news items from the admin tools.
  • Moved content of DiscourseLatestNewsComponent to LatestNewsComponent which is shared between Discourse and Admin news.
  • Admin news items link to pre-existing /news page.
  • NewsComponent was using [innerHTML]="sanitizer.bypassSecurityTrustHtml(newsItem.news)" instead of just displaying the text. I didn't see any reason it shouldn't just display the text, so I changed it, but I'm not sure if that was something important.

Test

  • When Discourse url and news category are set, the home page should still show Discourse news, otherwise it should show admin news.
  • Admin news should show the 3 latest public news items.
  • The More News button should link to the separate admin news page.
  • Each of the three news items should link to that same page and should automatically scroll to that news item.
  • If signed out, the news page should only show public news items. If signed in, it should show all news items.

@Aaron-Detre Aaron-Detre self-assigned this Jun 25, 2026
@Aaron-Detre Aaron-Detre added the enhancement New feature of any size or improvement (UI, performance, security) label Jun 25, 2026
@qltysh

qltysh Bot commented Jun 25, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

Unable to calculate total coverage change because base branch coverage was not found.

Modified Files with Diff Coverage (6)

RatingFile% DiffUncovered Line #s
New Coverage rating: A
.../home/discourse-latest-news/discourse-latest-news.component.ts100.0%
New Coverage rating: A
src/app/home/latest-news/latest-news.component.ts100.0%
New Coverage rating: A
src/app/discourse-feed/discourse-feed.component.ts100.0%
New Coverage rating: A
src/app/home/admin-latest-news/admin-latest-news.component.ts100.0%
New Coverage rating: B
src/app/home/home.component.ts100.0%
New Coverage rating: B
src/app/news/news.component.ts75.0%57, 66-71
Total92.2%
🤖 Increase coverage with AI coding...
In the `admin-news-on-home` branch, add test coverage for this new code:

- `src/app/news/news.component.ts` -- Lines 57 and 66-71

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@Aaron-Detre Aaron-Detre marked this pull request as ready for review June 25, 2026 18:11

@hirokiterashima hirokiterashima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking great! 👍 Features work as described.

Let's add back the bypassSecurityTrustHtml() bit. This allows the admins to use HTML syntax in their news posts, like adding a link or making text bold. Without it, it will show those html blocks, which is not ideal.

Also, see code improvement suggestions inline. I may not have caught all the places to clean up unused import/code.

Comment thread src/app/news/news.component.ts Outdated
Comment thread src/app/home/admin-latest-news/admin-latest-news.component.ts Outdated
Comment thread src/app/home/admin-latest-news/admin-latest-news.component.ts Outdated
Comment thread src/app/home/discourse-latest-news/discourse-latest-news.component.ts Outdated

@hirokiterashima hirokiterashima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@hirokiterashima hirokiterashima merged commit 201bc26 into develop Jun 30, 2026
4 checks passed
@hirokiterashima hirokiterashima deleted the admin-news-on-home branch June 30, 2026 23:08
@hirokiterashima

Copy link
Copy Markdown
Member

🎉 This PR is included in version 5.234.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature of any size or improvement (UI, performance, security) released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants