Commit Graph

1095 Commits

Author SHA1 Message Date
a30a861546 FIX: Poll: do not attempt to show voter list on private polls (#27714)
* FIX: avoid attempting to enrich results with undefined voters
2024-07-04 18:20:37 +02:00
e3b6be15b8 FEATURE: Add Instant Run-off Voting to Poll Plugin (Part 1: migrate existing plugin to Glimmer only) (#27204)
The "migration to Glimmer" has been broken out here from #27155 to make the review process less onerous and reduce change risk: 

* DEV: migrates most of the widget code to Glimmer in prep for IRV additions
* NB This already incorporates significant amounts of review and feedback from the prior PR.
* NB because there was significant additional feedback relating to older Poll code that I've improved with feedback, there are some additional changes here that are general improvements to the plugin and not specific to IRV nor Glimmer!
* There should be no trace of IRV code here.

Once this is finalised and merged we can continue to progress with #27155.
2024-07-04 13:34:48 +02:00
e5c0cfcd27 UX: remove default use of quaternary color, update nav pill styles (#27502) 2024-06-24 09:54:34 -04:00
8d4c9523ee DEV: Convert some tests to qunit-dom (#27577)
(and fix two test bugs)
2024-06-23 22:34:15 +02:00
81fe4ed248 Update translations (#27274) 2024-05-31 12:27:26 +02:00
2a28cda15c DEV: Update to lastest rubocop-discourse 2024-05-27 18:06:14 +02:00
9d8044a2ee FEATURE: Add Uyghur language (#27183)
Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2024-05-27 09:58:18 +02:00
e579cfc08f DEV: Avoid using the old action helper (#26935) 2024-05-08 20:26:48 +02:00
12cba2ce24 PERF: bail out of expensive post validations
Whenever a post already failed "lightweight" validations, we skip all the expensive validations (that cooks the post or run SQL queries) so that we reply as soon as possible.

Also skip validating polls when there's no "[/poll]" in the raw.

Internal ref - t/115890
2024-05-07 18:56:16 +02:00
6c6a56139e FIX: nested polls
Polls should work when "nested" inside a quote or a details block.

Internal ref - t/89085
2024-05-03 19:46:13 +02:00
5c2ac4fe88 DEV: Allow RenderGlimmer to be used inside post-cooked-glued widgets (#26675)
In this case, the top-level widget being glued must have a `_postCookedWidget` attribute.
2024-04-18 15:39:29 +01:00
18bb6b0871 DEV: Do not attempt to update polls if there are no polls before and after (#26573) 2024-04-12 13:16:10 +08:00
f2a781bcd0 Update translations (#26368) 2024-03-26 16:30:01 +01:00
4c860995e0 DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00
ec3d29a1fa Update translations (#26136) 2024-03-12 15:40:11 +01:00
5d90332cfc DEV: Use the "new" service import (#26059) 2024-03-06 18:05:11 +01:00
11067c73d0 DEV: Use fn+mut instead of action+mut (#26057)
One step closer to removing all `action` helper usage
2024-03-06 18:05:03 +01:00
6791eb1a94 Update translations (#26030) 2024-03-05 16:47:46 +01:00
f7d7092a7a DEV: Update rubocop-discourse to latest version
The lastest version of rubocop-discourse enables rules regarding
plugins.
2024-03-04 15:08:35 +01:00
ef292d1fed DEV: Shorten a condition (#25951) 2024-02-29 12:57:53 +08:00
eea7af09fd Update translations (#25914) 2024-02-27 20:50:30 +01:00
716e3a4dd5 Update translations (#25767) 2024-02-20 09:42:19 -05:00
8eab06cb2f Update translations (#25659) 2024-02-13 16:11:30 +01:00
c8c20585a7 Update translations (#25579) 2024-02-06 22:35:44 +01:00
c3b8216869 Update translations (#25476) 2024-01-30 17:05:37 +01:00
6b185f8655 PERF: eliminate some slow CSS selectors (#25392) 2024-01-26 13:10:45 -05:00
fd3c3fa565 DEV: Use service: lookups instead of :main (#25402)
where applicable
2024-01-24 15:59:44 +01:00
da2c0cd5c0 Update translations (#25386) 2024-01-23 18:29:34 +01:00
a03f87bdbd DEV: Move core plugin TL -> group settings (#25355)
* DEV: Change poll_minimum_trust_level_to_create to group based setting

New setting is poll_create_allowed_groups

c.f. https://meta.discourse.org/t/changes-coming-to-settings-for-giving-access-to-features-from-trust-levels-to-groups/283408

* DEV: Move styleguide_admin_only to group based setting

Not exactly a TL -> group change, but still part of the
overall effort here:

https://meta.discourse.org/t/changes-coming-to-settings-for-giving-access-to-features-from-trust-levels-to-groups/283408

New setting is styleguide_allowed_groups
2024-01-23 11:35:14 +10:00
50f8a51923 Update translations (#25278) 2024-01-16 14:54:32 +01:00
2e0ec679c5 Update translations (#25185) 2024-01-09 15:09:36 +01:00
1f72152e47 DEV: Remove usage of min_trust_to_create_topic SiteSetting (#24887)
Using min_trust_to_create_topic and create_topic_allowed_groups together was part of #24740

Now, when plugins specs are fixed, we can safely remove that part of logic.
2023-12-18 13:39:53 +11:00
41942357ed DEV: Use class attribute instead of @class arg (#24804) 2023-12-12 13:09:05 +01:00
694b5f108b DEV: Fix various rubocop lints (#24749)
These (21 + 3 from previous PRs) are soon to be enabled in rubocop-discourse:

Capybara/VisibilityMatcher
Lint/DeprecatedOpenSSLConstant
Lint/DisjunctiveAssignmentInConstructor
Lint/EmptyConditionalBody
Lint/EmptyEnsure
Lint/LiteralInInterpolation
Lint/NonLocalExitFromIterator
Lint/ParenthesesAsGroupedExpression
Lint/RedundantCopDisableDirective
Lint/RedundantRequireStatement
Lint/RedundantSafeNavigation
Lint/RedundantStringCoercion
Lint/RedundantWithIndex
Lint/RedundantWithObject
Lint/SafeNavigationChain
Lint/SafeNavigationConsistency
Lint/SelfAssignment
Lint/UnreachableCode
Lint/UselessMethodDefinition
Lint/Void

Previous PRs:
Lint/ShadowedArgument
Lint/DuplicateMethods
Lint/BooleanSymbol
RSpec/SpecFilePathSuffix
2023-12-06 23:25:00 +01:00
22bb1c8951 UX: improve poll text wrap (#24732) 2023-12-06 10:58:06 -05:00
30d5e752d7 DEV: Revert guardian changes (#24742)
I took the wrong approach here, need to rethink.

* Revert "FIX: Use Guardian.basic_user instead of new (anon) (#24705)"

This reverts commit 9057272ee242b3bc977e50977b4142066c36c05d.

* Revert "DEV: Remove unnecessary method_missing from GuardianUser (#24735)"

This reverts commit a5d4bf6dd28a8304ccd519536f33bd4a13232ed4.

* Revert "DEV: Improve Guardian devex (#24706)"

This reverts commit 77b6a038bae010c9e9e630a137f9ccd570f60784.

* Revert "FIX: Introduce Guardian::BasicUser for oneboxing checks (#24681)"

This reverts commit de983796e1b66aa2ab039a4fb6e32cec8a65a098.
2023-12-06 16:37:32 +10:00
9057272ee2 FIX: Use Guardian.basic_user instead of new (anon) (#24705)
c.f. de983796e1b66aa2ab039a4fb6e32cec8a65a098

There will soon be additional login_required checks
for Guardian, and the intent of many checks by automated
systems is better fulfilled by using BasicUser, which
simulates a logged in TL0 forum user, rather than an
anon user.

In some cases the use of anon still makes sense (e.g.
anonymous_cache), and in that case the more explicit
`Guardian.anon_user` is used
2023-12-06 11:56:21 +10:00
cae2b83af8 Update translations (#24716) 2023-12-05 14:39:08 +01:00
c90772fd3a Update translations (#24599) 2023-11-29 10:41:27 +01:00
21d614215b DEV: Use staged user check instead (#24578)
This change refactors the check `user.groups.any?` and instead uses
`user.staged?` to check if the user is staged or not.

Also fixes several tests to ensure the users have their auto trust level
groups created.

Follow up to:

- 8a45f84277e6e13bc48b8f4e40350a9cbd5cd2ee
- 447d9b210556e64c14f9ca9f8f9b52f54090cd41
- c89edd9e86870f97a770816210d71400f09181f2
2023-11-28 07:34:02 -07:00
c33a20cff6 Update translations (#24485) 2023-11-21 14:36:16 +01:00
91d5b66a9c UX: html-safe dialog.message, clarify poll error (#24388) 2023-11-15 11:37:25 -05:00
c36ee3bc02 Update translations (#24366) 2023-11-14 14:30:11 +01:00
f395130429 FEATURE: Configure poll 'public' default via site setting (#24348)
Followup to 7e37e3e82409ffa59b9720c132e1bba7b02874a3
2023-11-13 18:54:21 +00:00
8444c865e9 DEV: remove slightly less trivial {{action}} usages (#24289)
Follow-up to #24278 that is slightly less trivial.

* Some were "trivial" usages that were missed in the previous PR because the same file that had at least one other non-trivial usage.
* These involve extra arguments or inheritance but I have checked that they seem correct.
2023-11-13 13:29:20 +01:00
7e37e3e824 UX: Create polls with public=true by default (#24332)
In the vast majority of cases, people want poll voters to be public. Previously, the checkbox for this was hidden behind the 'show advanced' settings in the poll builder UI.

This commit makes three changes to improve the experience:

1. Add `public=true|false` to poll markup (previously it would only be added when true

2. Bring the 'public' switch outside the 'show advanced' section for improved visibility

3. Change the default to 'true'
2023-11-13 09:07:51 +11:00
6e161d3e75 DEV: Allow fab! without block (#24314)
The most common thing that we do with fab! is:

    fab!(:thing) { Fabricate(:thing) }

This commit adds a shorthand for this which is just simply:

    fab!(:thing)

i.e. If you omit the block, then, by default, you'll get a `Fabricate`d object using the fabricator of the same name.
2023-11-09 16:47:59 -06:00
c34f8b65cb DEV: Rename I18n imports to discourse-i18n (#23915)
As of #23867 this is now a real package, so updating the imports to
use the real package name, rather than relying on the alias. The
name change in the package name is because `I18n` is not a valid
name as NPM packages must be all lowercase.

This commit also introduces an eslint rule to prevent importing from
the old I18n path.

For themes/plugins, the old 'i18n' name remains functional.
2023-10-18 11:07:09 +01:00
ee084b754e SECURITY: Prevent unauthorized access to grouped poll results
This adds access controls for the `/polls/grouped_poll_results`
endpoint, such that only users with appropriate permissions can read
the grouped results of a given poll.
2023-10-16 10:34:37 -04:00
48193767bf DEV: Sort imports
Automatically generated by `eslint --fix` to satisfy the updated configuration
2023-10-10 21:46:54 +01:00