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

refactor(ui/stat): use class selector for pageview elements by default #880

Merged
merged 5 commits into from
May 23, 2024

Conversation

qwqcode
Copy link
Member

@qwqcode qwqcode commented May 22, 2024

The statistics UI component has been updated. The default selectors for pvEl and countEl have changed from #ArtalkPV and #ArtalkCount to .artalk-pv-count and .artalk-comment-count (see #826 for more details). However, it remains backward compatible with the #ArtalkPV and #ArtalkCount elements for older versions, no HTML client updates are necessary.

In this PR, we also introduced a configuration option called statPageKeyAttr (value "data-page-key" by default) for customizing the attribute name that the statistics component uses to fetch the page key.

fixes #826

BREAKING CHANGE: Modified statistics UI component. Default selectors for `pvEl` and `countEl` have changed from `#ArtalkPV` and `#ArtalkCount` to `.artalk-pv-count` and `.artalk-comment-count` (See #826).
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.30%. Comparing base (53d46d8) to head (d011c18).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #880      +/-   ##
==========================================
+ Coverage   25.23%   25.30%   +0.07%     
==========================================
  Files         196      196              
  Lines        8093     8093              
==========================================
+ Hits         2042     2048       +6     
+ Misses       5924     5920       -4     
+ Partials      127      125       -2     
Flag Coverage Δ
go 25.30% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@qwqcode qwqcode requested a review from Mister-Hope May 22, 2024 15:25
Copy link
Contributor

@Mister-Hope Mister-Hope left a comment

Choose a reason for hiding this comment

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

LGTM

Note: I only checked the modified code.

@qwqcode qwqcode requested a review from Mister-Hope May 23, 2024 04:28
@qwqcode
Copy link
Member Author

qwqcode commented May 23, 2024

I added backward compatible selector query #ArtalkPV and #ArtalkCount and unit test :)

this is no longer a BREAKING CHANGE

@qwqcode qwqcode merged commit 824f122 into master May 23, 2024
12 checks passed
@qwqcode qwqcode deleted the refactor/ui/stat branch May 23, 2024 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] 更新当前的浏览量逻辑
2 participants