Skip to content
Snippets Groups Projects
Unverified Commit 52813830 authored by mayaeh's avatar mayaeh Committed by GitHub
Browse files

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: default avatarClaire <claire.github-309c@sitedethib.com>

Co-authored-by: default avatarEugen Rochko <eugen@zeonfederated.com>
Co-authored-by: default avatarClaire <claire.github-309c@sitedethib.com>
parent 69076050
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,7 @@ export default class Counter extends React.PureComponent { ...@@ -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 { ...@@ -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 { ...@@ -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>
); );
......
...@@ -11,7 +11,7 @@ ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment