Commit Graph

426 Commits

Author SHA1 Message Date
Alan Guo Xiang Tan ca82bab131
FIX: Search advanced order after changes in core. (#79)
See 4b3f65bb26
2021-02-05 09:55:33 +08:00
Bianca Nenciu dd21880cc4
FIX: Always serialize can_vote for first posts (#78)
Changing category settings would not always unhide the like button
because the model would not be updated on the client side until a full
page refresh.
2021-02-01 11:37:14 +02:00
Joffrey JAFFEUX ce497cff6b
DEV: prettier 2.2.1 (#77) 2021-01-27 10:45:24 +01:00
Discourse Translator Bot 7108e7ff6a
Update translations (#76) 2021-01-26 14:47:14 +01:00
Gerhard Schlager 5cfe83e115
Revert "Update translations (#73)" (#74)
This reverts commit 4907974ccb.
2021-01-19 15:16:33 +01:00
Discourse Translator Bot 4907974ccb
Update translations (#73) 2021-01-19 14:54:29 +01:00
Discourse Translator Bot c94b04c2fc
Update translations (#72) 2021-01-12 14:26:25 +01:00
Osama Sayegh 8dbc75f965
FIX: Upsert topic votes count atomically (#71)
The `Topic#update_vote_count` method should be concurrency-safe to prevent unique constraint violation errors when multiple processes try to insert a topic_votes_count record for the same topic simultaneously.

Signed-off-by: OsamaSayegh <asooomaasoooma90@gmail.com>
2021-01-07 07:26:52 +03:00
Discourse Translator Bot 148d76facc
Update translations (#70) 2020-12-22 14:45:02 +01:00
Discourse Translator Bot c456bf2e11
Update translations (#69) 2020-12-01 14:33:14 +01:00
Discourse Translator Bot 64f9f6f073
Update translations (#68) 2020-11-24 17:21:13 +01:00
David Taylor b3122ff72f
DEV: Cleanup DiscourseEvent handler after spec (#67)
See https://github.com/discourse/discourse/pull/11205
2020-11-11 19:13:02 +00:00
Krzysztof Kotlarek ad039b4adc
FIX: the correct path to user profile (#66)
We should use `/u/:login` instead of `/users/:login`
2020-11-02 17:26:23 +11:00
Discourse Translator Bot d09048e026 Update translations 2020-10-27 15:34:07 +01:00
Discourse CI b7d00c7bbd DEV: Update CI workflows 2020-10-14 16:27:54 +00:00
jjaffeux f422e635ca Revert "DEV: enforces no-var (#62)"
This reverts commit 8610904f23.
2020-10-13 15:43:20 +02:00
Discourse Translator Bot 43b94d1bf5 Update translations 2020-10-13 15:16:38 +02:00
Jarek Radosz f15941c716
DEV: Remove Travis CI (#63)
We're using GitHub Actions CI already.
2020-10-13 11:37:28 +02:00
Joffrey JAFFEUX 8610904f23
DEV: enforces no-var (#62) 2020-10-13 11:36:59 +02:00
Discourse CI 4ea3ac4238 DEV: Update CI workflows 2020-10-12 08:26:41 +00:00
Discourse CI 9521be8e82 DEV: Update CI workflows 2020-10-09 19:17:52 +00:00
Discourse CI 8a1c46821a DEV: Update CI workflows 2020-10-09 16:15:21 +00:00
Jarek Radosz 864cf46500
DEV: Refactor buttonTitle (#61)
Should be a tiny bit easier to follow now.
2020-10-06 19:35:38 +02:00
Jarek Radosz b92385aada
FIX: Delete the votes on user removal (#59)
There are some assumptions in the code that `vote.user` exists. It makes sense to boop the votes out of existence when their owner is destroyed.
2020-10-06 18:04:26 +02:00
Joffrey JAFFEUX 2276d02718
DEV: removes useless assignment, buttonTitle is always overwritten (#60) 2020-10-06 10:11:35 +02:00
Jarek Radosz 8ebda184fa
FIX: Ask to log in before requesting who_voted (#58)
`/voting/who` path has `ensure_logged_in` so clicking the vote count to see who voted triggered http requests that ended with 403 error. Now, users are asked to log in, just like when clicking the "vote" button.
2020-10-05 12:23:35 +02:00
Krzysztof Kotlarek 1d501226fe
FIX: don't send xhr request when vote limit is reached (#57)
When the user used all the votes we should not send a request to create a vote. We should only display information about votes.

The bug was mentioned on meta: https://meta.discourse.org/t/the-vote-button-should-be-disabled-when-the-limit-is-reached/68902
2020-09-30 15:42:34 +10:00
Justin DiRose fdedc0e159
DEV: Add plugin testing workflow 2020-09-25 13:10:01 -05:00
Justin DiRose 0d53d25457
DEV: Add linting workflow 2020-09-25 13:09:48 -05:00
Discourse Translator Bot 4d7c042532 Update translations 2020-09-22 13:07:48 +00:00
Justin DiRose c82d5a6645
FIX: Stop trying to merge duplicate votes (#56)
Was able to reproduce a bug where votes were not properly moved when merging two topics together. We were only checking duplicate votes if either both votes were either active or archived, and not a mix of the two. As a result, there were cases where the plugin was trying to move votes that already existed on an open topic, causing the merge to partially fail with a duplicate index error.

What this commit does is as follows:

- Cleaned up the logic so it's more readable. Previously it was duplicative and difficult to read.
- We're now checking if a user has a vote on Topic A (active or archived) and Topic B (active or archived) that we're properly deleting the origin vote and keeping the destination vote instead of trying to merge in a duplicate. (This caused the original bug described above).
- Per the specs on meta, topic merges move all votes to the destination topic, and if this causes a user to go over the limit, they'll have to wait until enough votes are released.
- If the destination topic is closed, the votes will be archived; if the destination topic is open, those votes will be active. This is regardless of origin vote state.

Also, the Gemfile was missing a source declaration to allow installation of gems/dependencies, so I've added that.
2020-09-17 11:02:19 -05:00
Discourse Translator Bot 5e69dbfd5b Update translations 2020-09-16 10:22:04 +00:00
Discourse Translator Bot 32989b7d3a Update translations 2020-09-15 13:08:02 +00:00
Krzysztof Kotlarek b564224c0a
FIX: the ability to remove the vote (#55)
Problem was that we are adding `hidden` class to popup and jQuery `toggle()` function is not handling that properly. Therefore I decided to use `toggleClass` in that case and it works pretty well.

The bug was mentioned here - https://meta.discourse.org/t/voting-plugin/157676/8
2020-09-15 16:21:18 +10:00
David Taylor 835b3580b7
FIX: Skip migrating null/blank custom field values in migrations 2020-09-09 17:00:56 +01:00
Discourse Translator Bot 2bd2600476 Update translations 2020-09-09 15:00:39 +00:00
Joffrey JAFFEUX 0a1464a84a
DEV: apply coding standards (#54) 2020-09-04 13:20:28 +02:00
Discourse Translator Bot 2db19138b4 Update translations 2020-08-25 13:04:04 +00:00
Kris b33f004d9b UX: Structure the list-vote-count like tags and assigns 2020-08-19 00:05:03 -04:00
Discourse Translator Bot fd94a53ae3 Update translations 2020-08-18 13:04:42 +00:00
Krzysztof Kotlarek 18794557db
FIX: backwards compatibility with stable discourse 2.5.0 (#53)
Few if statements to ensure plugin works with a stable discourse. Completely obsolete once 2.6.0 will become stable
2020-08-18 10:26:10 +10:00
Régis Hanol 8de0fa9ecf DEV: ensure compatibilty with stable 2020-08-17 16:21:16 +02:00
David Taylor 142b3db6b8
FIX: Skip duplicate data when migrating from custom fields 2020-08-17 12:57:55 +01:00
Régis Hanol 15949af1b9 FIX: suggested topics had their topic_ids set to a post_id
The fix is pretty simple

    result = result.select("*, ... AS current_user_voted")

become

    result = result.select("topics.*, ... AS current_user_voted")

I also merged all 3 'TopicQuery.results_filter_callbacks' into one and did
some slight refactoring on the 'add_to_serializer'.
2020-08-17 11:15:24 +02:00
Krzysztof Kotlarek e2c2f51799 FIX: dont error when topic without category 2020-08-17 16:18:16 +10:00
Krzysztof Kotlarek 74c09d58b0 FIX: bump version to 0.5 2020-08-17 15:46:02 +10:00
Krzysztof Kotlarek 0f0e76f170
FIX: move data to separate tables (#52)
We are trying to avoid custom tables. Changes:
CategoryCustomField -> DiscourseVoting::CategorySetting # contains infromation if voting is enabled for category
UserCustomField -> DiscourseVoting::Vote # user's votes
TopicCustomField -> DiscourseVoting::VoteCounter # cache count for topics
2020-08-17 15:01:33 +10:00
Discourse Translator Bot 06adb63503 Update translations 2020-08-11 13:07:15 +00:00
Penar Musaraj 49c9e5514f
Use eslint-config-discourse for dev dependencies 2020-08-05 15:57:39 -04:00
Penar Musaraj 00be85df7f
Use CSS custom properties for stylesheet colors 2020-08-05 15:46:38 -04:00