Add a hashtag public link to the trending hashtag page (#17140)

* Add a hashtag public link to the hashtag management page

* Add support for element 'target' to Counter.js.
Remove 'rel' element.

* Update app/javascript/mastodon/components/admin/Counter.js

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
main
mayaeh 2022-03-26 10:52:51 +09:00 committed by GitHub
parent 6907605026
commit 52813830be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -33,6 +33,7 @@ export default class Counter extends React.PureComponent {
label: PropTypes.string.isRequired, label: PropTypes.string.isRequired,
href: PropTypes.string, href: PropTypes.string,
params: PropTypes.object, params: PropTypes.object,
target: PropTypes.string,
}; };
state = { state = {
@ -54,7 +55,7 @@ export default class Counter extends React.PureComponent {
} }
render () { render () {
const { label, href } = this.props; const { label, href, target } = this.props;
const { loading, data } = this.state; const { loading, data } = this.state;
let content; let content;
@ -100,7 +101,7 @@ export default class Counter extends React.PureComponent {
if (href) { if (href) {
return ( return (
<a href={href} className='sparkline'> <a href={href} className='sparkline' target={target}>
{inner} {inner}
</a> </a>
); );

View File

@ -11,7 +11,7 @@
.dashboard .dashboard
.dashboard__item .dashboard__item
= react_admin_component :counter, measure: 'tag_accounts', start_at: @time_period.first, end_at: @time_period.last, params: { id: @tag.id }, label: t('admin.trends.tags.dashboard.tag_accounts_measure') = react_admin_component :counter, measure: 'tag_accounts', start_at: @time_period.first, end_at: @time_period.last, params: { id: @tag.id }, label: t('admin.trends.tags.dashboard.tag_accounts_measure'), href: tag_url(@tag), target: '_blank'
.dashboard__item .dashboard__item
= react_admin_component :counter, measure: 'tag_uses', start_at: @time_period.first, end_at: @time_period.last, params: { id: @tag.id }, label: t('admin.trends.tags.dashboard.tag_uses_measure') = react_admin_component :counter, measure: 'tag_uses', start_at: @time_period.first, end_at: @time_period.last, params: { id: @tag.id }, label: t('admin.trends.tags.dashboard.tag_uses_measure')
.dashboard__item .dashboard__item