ratings-fix
This commit is contained in:
parent
5b7d8a1658
commit
d38adbfc61
14
package-lock.json
generated
14
package-lock.json
generated
|
@ -11,7 +11,6 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@authorizerdev/authorizer-js": "1.2.11",
|
"@authorizerdev/authorizer-js": "1.2.11",
|
||||||
"ackee-tracker": "5.1.0",
|
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
"i18next": "22.4.15",
|
"i18next": "22.4.15",
|
||||||
"i18next-icu": "2.3.0",
|
"i18next-icu": "2.3.0",
|
||||||
|
@ -6379,14 +6378,6 @@
|
||||||
"tslib": "^2.3.1"
|
"tslib": "^2.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ackee-tracker": {
|
|
||||||
"version": "5.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ackee-tracker/-/ackee-tracker-5.1.0.tgz",
|
|
||||||
"integrity": "sha512-A7iKkGyUnEXuOzxultQB7hnm4bStYCo1c38MYRRihBfqUP8AImhtZOODb00t9xrXs/BTsg06bz1MKpXeMs9sYw==",
|
|
||||||
"dependencies": {
|
|
||||||
"platform": "^1.3.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/acorn": {
|
"node_modules/acorn": {
|
||||||
"version": "8.11.3",
|
"version": "8.11.3",
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
|
||||||
|
@ -15953,11 +15944,6 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/platform": {
|
|
||||||
"version": "1.3.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
|
|
||||||
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
|
|
||||||
},
|
|
||||||
"node_modules/pluralize": {
|
"node_modules/pluralize": {
|
||||||
"version": "8.0.0",
|
"version": "8.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz",
|
||||||
|
|
|
@ -48,14 +48,14 @@ type VisibilityItem = {
|
||||||
}
|
}
|
||||||
|
|
||||||
type FeedSearchParams = {
|
type FeedSearchParams = {
|
||||||
by: 'publish_date' | 'rating' | 'last_comment'
|
by: 'publish_date' | 'likes_stat' | 'rating' | 'last_comment'
|
||||||
period: FeedPeriod
|
period: FeedPeriod
|
||||||
visibility: VisibilityMode
|
visibility: VisibilityMode
|
||||||
}
|
}
|
||||||
|
|
||||||
const getOrderBy = (by: FeedSearchParams['by']) => {
|
const getOrderBy = (by: FeedSearchParams['by']) => {
|
||||||
if (by === 'rating') {
|
if (by === 'likes_stat' || by === 'rating') {
|
||||||
return 'rating_stat'
|
return 'likes_stat'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (by === 'last_comment') {
|
if (by === 'last_comment') {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useLocalize } from '../../context/localize'
|
||||||
import styles from '../../styles/FeedSettings.module.scss'
|
import styles from '../../styles/FeedSettings.module.scss'
|
||||||
|
|
||||||
// type FeedSettingsSearchParams = {
|
// type FeedSettingsSearchParams = {
|
||||||
// by: '' | 'topics' | 'authors' | 'reacted'
|
// by: '' | 'topics' | 'authors' | 'shouts'
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export const FeedSettingsView = (_props) => {
|
export const FeedSettingsView = (_props) => {
|
||||||
|
@ -25,7 +25,7 @@ export const FeedSettingsView = (_props) => {
|
||||||
<a href="?by=authors">{t('authors')}</a>
|
<a href="?by=authors">{t('authors')}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="?by=reacted">{t('reactions')}</a>
|
<a href="?by=shouts">{t('publications')}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ export default gql`
|
||||||
published_at
|
published_at
|
||||||
stat {
|
stat {
|
||||||
viewed
|
viewed
|
||||||
reacted
|
|
||||||
rating
|
rating
|
||||||
commented
|
commented
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ export default gql`
|
||||||
published_at
|
published_at
|
||||||
stat {
|
stat {
|
||||||
viewed
|
viewed
|
||||||
reacted
|
|
||||||
rating
|
rating
|
||||||
commented
|
commented
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ export default gql`
|
||||||
published_at
|
published_at
|
||||||
stat {
|
stat {
|
||||||
viewed
|
viewed
|
||||||
reacted
|
|
||||||
rating
|
rating
|
||||||
commented
|
commented
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ export default gql`
|
||||||
published_at
|
published_at
|
||||||
stat {
|
stat {
|
||||||
viewed
|
viewed
|
||||||
reacted
|
|
||||||
rating
|
rating
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ export default gql`
|
||||||
published_at
|
published_at
|
||||||
stat {
|
stat {
|
||||||
viewed
|
viewed
|
||||||
reacted
|
|
||||||
rating
|
rating
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ export default gql`
|
||||||
published_at
|
published_at
|
||||||
stat {
|
stat {
|
||||||
viewed
|
viewed
|
||||||
reacted
|
|
||||||
rating
|
rating
|
||||||
commented
|
commented
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ export default gql`
|
||||||
published_at
|
published_at
|
||||||
stat {
|
stat {
|
||||||
viewed
|
viewed
|
||||||
reacted
|
|
||||||
rating
|
rating
|
||||||
commented
|
commented
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ export default gql`
|
||||||
published_at
|
published_at
|
||||||
stat {
|
stat {
|
||||||
viewed
|
viewed
|
||||||
reacted
|
|
||||||
rating
|
rating
|
||||||
commented
|
commented
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,7 @@ export const loadTopMonthArticles = async (): Promise<void> => {
|
||||||
published: true,
|
published: true,
|
||||||
after,
|
after,
|
||||||
},
|
},
|
||||||
order_by: 'rating_stat',
|
order_by: 'likes_stat',
|
||||||
limit: TOP_MONTH_ARTICLES_COUNT,
|
limit: TOP_MONTH_ARTICLES_COUNT,
|
||||||
}
|
}
|
||||||
const articles = await apiClient.getShouts(options)
|
const articles = await apiClient.getShouts(options)
|
||||||
|
@ -209,7 +209,7 @@ const TOP_ARTICLES_COUNT = 10
|
||||||
export const loadTopArticles = async (): Promise<void> => {
|
export const loadTopArticles = async (): Promise<void> => {
|
||||||
const options: LoadShoutsOptions = {
|
const options: LoadShoutsOptions = {
|
||||||
filters: { published: true },
|
filters: { published: true },
|
||||||
order_by: 'rating_stat',
|
order_by: 'likes_stat',
|
||||||
limit: TOP_ARTICLES_COUNT,
|
limit: TOP_ARTICLES_COUNT,
|
||||||
}
|
}
|
||||||
const articles = await apiClient.getShouts(options)
|
const articles = await apiClient.getShouts(options)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user