Skip to content

Commit

Permalink
fix: Misc activity log fixes (#1195)
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree committed Feb 7, 2024
1 parent 44fe349 commit 5c8f47e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
1 change: 0 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ rules:
no-plusplus: off
radix: off
eol-last: ['warn']
no-nested-ternary: ['warn']
prefer-const: ['warn']
no-restricted-globals: ['error', 'event', 'fdescribe']
no-mixed-operators: ['warn']
Expand Down
10 changes: 4 additions & 6 deletions app/components/Users/ActivityLog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ const ActivityLog = ({ match, t, location }) => {
return <ErrorView error={error} />
}

if (!loading && get(data, 'user.actions.entries.length') === 0) {
return <MessageView>{t('noActivity')}</MessageView>
}

const paginationMenu = renderPaginationMenu(loading, get(data, 'user'), fetchMore)
const isEmpty = get(data, 'user.actions.entries.length') === 0
return (
<div>
<div className="activity-log container">
Expand All @@ -101,6 +97,8 @@ const ActivityLog = ({ match, t, location }) => {
<div className="panel-block">
<LoadingFrame />
</div>
) : isEmpty ? (
<MessageView>{t('noActivity')}</MessageView>
) : (
data.user.actions.entries.map((a) => (
<UserAction
Expand All @@ -111,7 +109,7 @@ const ActivityLog = ({ match, t, location }) => {
/>
))
)}
{paginationMenu}
{!isEmpty && renderPaginationMenu(loading, get(data, 'user'), fetchMore)}
</div>
</div>
)
Expand Down
1 change: 1 addition & 0 deletions app/components/UsersActions/ActionIcon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const ACTIONS_ICONS = {
add: 'plus',
revert: 'undo',
flag: 'flag',
confirmed_flag: 'flag',
vote_up: 'chevron-up',
vote_down: 'chevron-down',
self_vote: 'chevron-up',
Expand Down
2 changes: 1 addition & 1 deletion app/components/UsersActions/ActionsDirectionFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Link } from 'react-router-dom'
import UserAppellation from '../Users/UserAppellation'

const ActionsDirectionFilter = ({ user, value, t }) => {
const baseLink = `/u/${user.username}/activity`
const baseLink = `/u/${user.username}`
const getLinkProps = (filterValue) => ({
className: filterValue === value ? 'is-active' : '',
to: filterValue === 'ALL' ? baseLink : `${baseLink}?direction=${filterValue}`,
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/en/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
"action_banned_bad_language": "Moderated ($t(moderation:reason.1))",
"action_banned_spam": "Moderated ($t(moderation:reason.2))",
"action_banned_irrelevant": "Moderated ($t(moderation:reason.3))",
"action_banned_not_constructive": "Moderated ($t(moderation:reason.4))"
"action_banned_not_constructive": "Moderated ($t(moderation:reason.4))",
"confirmed_flag": "Confirmed a flag",
"abused_flag": "Refuted a flag",
"social_network_linked": "Linked a social network account"
},
"actionTarget": {
"vote_up": "Received a positive vote",
Expand Down
5 changes: 4 additions & 1 deletion app/i18n/fr/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
"action_banned_bad_language": "Modéré ($t(moderation:reason.1))",
"action_banned_spam": "Modéré ($t(moderation:reason.2))",
"action_banned_irrelevant": "Modéré ($t(moderation:reason.3))",
"action_banned_not_constructive": "Modéré ($t(moderation:reason.4))"
"action_banned_not_constructive": "Modéré ($t(moderation:reason.4))",
"confirmed_flag": "A confirmé un signalement",
"abused_flag": "A réfuté d'un signalement",
"social_network_linked": "Compte lié à un réseau social"
},
"actionTarget": {
"vote_up": "Reçu un vote positif",
Expand Down

0 comments on commit 5c8f47e

Please sign in to comment.