Commit Graph

414 Commits

Author SHA1 Message Date
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
Discourse Translator Bot 0dbed63b21 Update translations 2020-08-05 13:31:06 +00:00
Discourse Translator Bot 6605e5d3da DEV: Switch from Transifex to Crowdin 2020-07-16 14:01:38 +02:00
Bianca Nenciu 0d4f38404b DEV: Remove computed field
There was a lot of code for very little functionality and it caused
issues with other plugin tests.
2020-07-10 15:54:05 +03:00
Robin Ward 47ae7d38d5 FIX: Broken tests 2020-07-07 16:15:16 -04:00
Robin Ward 28e0a098b8 FIX: Deprecation 2020-07-07 14:47:38 -04:00
Jarek Radosz 17f48ec3ee
DEV: Actually fix deprecation
Continuation of 8b0b6ec0c2 :P
2020-07-06 22:23:08 +02:00
Robin Ward 8b0b6ec0c2 FIX: Deprecation 2020-07-06 15:02:31 -04:00
Neil Lalonde 1d25aafb6a
Update translations 2020-06-24 11:42:49 -04:00
Gerhard Schlager d50d749b5f DEV: Use consistent interpolation key format in translations 2020-06-02 19:27:42 +02:00
Dan Ungureanu 639dce7a8b
FIX: Move archived votes when merging topics (#50) 2020-05-26 13:10:13 +03:00
Jarek Radosz e642fdf6fd DEV: Add rubocop-discourse gem 2020-05-06 18:14:42 +02:00
Neil Lalonde 3644fe8585
Update translations 2020-05-04 10:51:31 -04:00