Commit Graph

1082 Commits

Author SHA1 Message Date
cfcc60f847 FEATURE: new fast_typing_threshold site setting (#30865)
Rename `min_first_post_typing_time` to `fast_typing_threshold` and
provide admin 4 options:
- disabled
- low - 1 second
- standard - 3 seconds
- high - 5 seconds

Related PRs:
- https://github.com/discourse/discourse-zoom/pull/112
2025-01-28 09:53:03 +11:00
a1bbbbda02 DEV: Promote historic post_deploy migrations for core plugins. (#30987)
This commit promotes all post_deploy migrations which existed in
Discourse v3.3.0 (timestamp <= 20240717053710)
2025-01-24 11:47:03 -03:00
e98644fbc6 DEV: Replace remaining uses of query helper (#30019) 2025-01-22 00:25:03 +01:00
f0d6e9758d Update translations (#30898) 2025-01-21 15:55:30 +01:00
d88ee33eb6 DEV: Introduce stylelint (#29852)
Stylelint is a css linter: https://stylelint.io/

As part of this change we have added two javascript scripts:

```
pnpm lint:css
pnpm lint:css:fix
```

Look at `.vscode/settings.json.sample` and `.vscode/extensions.json` for
configuration in VSCode.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-01-20 15:27:42 +00:00
496a739788 Update translations (#30765) 2025-01-14 16:19:49 +01:00
acde5c4337 DEV: Enable discourse-common-imports eslint rule (#30742)
Applies the autofix, which caught a few places that were missed in the
original find/replace

See https://github.com/discourse/lint-configs/pull/91
2025-01-13 16:01:34 +00:00
0ed4b09527 DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733)
`discourse-common` was created in the past to share logic between the
'wizard' app and the main 'discourse' app. Since then, the wizard has
been consolidated into the main app, so the separation of
`discourse-common` is no longer useful.

This commit moves `discourse-common/(lib|utils)/*` into
`discourse/lib/*`, adds shims for the imports, and updates existing
uses in core.
2025-01-13 13:02:49 +00:00
1d7b1e587a Update translations 2025-01-07 21:56:56 +01:00
30be75460f UX: Admin setting page consistency - Group permissions (#30528) (#30578)
* UX: Admin setting page consistency - Group permissions (#30528)

Followup c2282439b32d879a73217eec62449f042914d7d0 and
21470e4afd49127fc6281a5bde6357e86b11a4ae

Adds a new "Group permissions" page and group_permissions site
setting area, which shows every single group-based site setting
in the app and core plugins.

Also adds a "trust_levels" area to show on the already moved
admin "Trust level" settings page, since that previously was
showing a mix of trust level settings and allowed group settings.

* DEV: Review fixes
2025-01-07 11:25:21 +10:00
a4c2653db8 DEV: Update rubocop-discourse (#30552)
…and autofix the issues
2025-01-04 13:48:21 +01:00
6c7eaf99af Update translations (#30434) 2025-01-03 14:01:32 +01:00
0336235c74 DEV: Use object spread instead of Object.assign (#30407) 2024-12-23 08:44:29 +01:00
1631c39391 Update translations (#30319) 2024-12-18 15:19:37 +01:00
8f6c99df8c DEV: Run prettier correctly for bundled-plugin test directories (#30338) 2024-12-18 12:02:28 +00:00
c65192a7a2 Update translations (#30202) 2024-12-10 20:16:34 +01:00
0f2033dd69 DEV: Update more deprecated Font Awesome icon names (#30163)
* DEV: Update more deprecated Font Awesome icon names

* revert update to icon-library test - test is covering deprecation case
2024-12-08 22:14:28 +01:00
838d7478c1 Update translations (#30062) 2024-12-04 11:59:28 +01:00
efa2589204 DEV: Finish qunit-dom hasText migration (#30017) 2024-12-01 14:00:48 +01:00
dfb74d90c3 DEV: Extensively use qunit-dom's hasText (#30012) 2024-11-30 16:44:51 +01:00
ef7518d4ad DEV: Fix no-loose-assertions lint (#29965)
and enable some of qunit lints
2024-11-28 11:22:27 +01:00
d6bec460a8 DEV: Upgrade Rails to version 7.2 2024-11-27 10:48:47 +01:00
b9f183e2c3 Update translations (#29934) 2024-11-26 23:14:56 +01:00
a692e87b72 DEV: lint poll test (#29937)
Co-authored-by: David Taylor <david@taylorhq.com>
2024-11-26 16:22:33 +01:00
7333a00ddb DEV: ensures poll-test is correctly linted (#29936)
Broken in a535798659
2024-11-26 14:18:30 +01:00
a535798659 FIX: Poll: ensure it is not possible to vote with all abstentions in Ranked Choice (#29601)
Make sure Cast Vote button is disabled when all abstain and remove any historic data that fails new zero rank vote validation
2024-11-26 20:16:22 +08:00
6f7c581a80 DEV: Bump @discourse/lint-configs and autofix (#29847)
In particular, this applies:

- new `discourse/no-implicit-this` template-lint rule
- `init`/`willDestroy` ordering enforcement
- `lines-between-class-members`
2024-11-20 14:15:04 +00:00
abfd065ff0 Update translations (#29835) 2024-11-20 00:21:25 +01:00
32665cf9dd DEV: Consolidate i18n import paths (#29804)
Enables our new eslint rules which enforce consistent i18n imports. For more info, see 0d58b40cd7
2024-11-19 20:45:18 +00:00
16a9663557 DEV: Use qunit-dom's isDisabled/isEnabled (#29675) 2024-11-10 02:24:58 +01:00
d67a6002eb DEV: Replace count with qunit-dom (#29674) 2024-11-10 02:06:03 +01:00
de6d575d40 DEV: Convert all uses of exists to qunit-dom (#29667) 2024-11-10 01:30:33 +01:00
c1916f7984 DEV: Convert assert.true(exists()) to qunit-dom (#29638) 2024-11-08 20:27:32 +01:00
1aa836163e FIX: poll ranked choice results not showing on first vote (#28542)
Currently (for Ranked Choice only) a javascript exception is raised on very first vote, preventing the results from being rendered requiring a browser refresh (which doesn't error).

Resolves: TypeError: this.args.rankedChoiceOutcome.round_activity is undefined with simple addition of optional chaining operator.
2024-11-05 09:29:07 +08:00
40a4d55c77 FIX: poll ranked choice voter expansion should append additional voters (#28432)
Currently, for Ranked Choice results and voter list expansion, the code is replacing the voter list with the newly fetched page of voters instead of appending to the existing voter list. This is resolved in this PR and brings it in line with regular polls.

See: https://meta.discourse.org/t/ranked-choice-poll-does-not-reflect-change-of-votes-in-outcome/321227/18
2024-11-05 09:28:32 +08:00
f371258b42 UX: Give ranked choice polls distinctive bullets in preview (#29439) 2024-10-28 11:10:37 -04:00
b9ec9c7e4f DEV: Update more asserts to qunit-dom (#29326)
regex find&replace + removing now-unused imports + manually fixing incorrect css selectors (that now got flagged 😌) + manually updating selectors that relied on jq
2024-10-22 11:34:23 +02:00
322a3be2db DEV: Remove logical OR assignment of constants (#29201)
Constants should always be only assigned once. The logical OR assignment
of a constant is a relic of the past before we used zeitwerk for
autoloading and had bugs where a file could be loaded twice resulting in
constant redefinition warnings.
2024-10-16 10:09:07 +08:00
688f65a39d DEV: Convert more test assertions to qunit-dom (#29214)
the PR is sponsored by vscode's regex support in find-and-replace 😉
2024-10-15 17:11:20 +02:00
a4531be580 Update translations (#29123) 2024-10-08 20:21:43 +02:00
50cb7b897e FIX: Use full column name to prevent ambiguous query (#29111)
This can happen when other plugins, for example discourse-rainbow, are
installed and add columns with same names.
2024-10-07 19:33:07 +03:00
76ad581f67 Update translations 2024-10-02 08:55:44 +02:00
dd5502f166 PERF: Cache serialized voters at topic view level (#28894)
This commit introduces a way to fetch the "serialized voters" for
multiple polls.

* Use a single query to fetch voters for all types of polls

* Refactor to introduce all_serialized_voters

* Cache serialized voters
2024-09-18 12:01:40 +03:00
a914d3230b DEV: remap all core icons for fontawesome 6 upgrade (#28715)
Followup to 7d8974d02f7360b324b446868463e950fe92883f

Co-authored-by: David Taylor <david@taylorhq.com>
2024-09-13 16:50:52 +01:00
18fca966c5 FIX: Incorrect titles in two components (#28865) 2024-09-11 22:45:41 +02:00
d63ffe22f4 DEV: Track SQL queries from MiniSql (#28824)
`track_sql_queries` only returned queries that were executed by
ActiveRecord. All queries executed through DB.exec, DB.query and others
were not returned.
2024-09-11 10:14:53 +03:00
1a88728d39 FIX: Poll voters list wasn't expanding properly (#28823) 2024-09-10 11:46:12 -04:00
9b0300a647 PERF: Preload voters_count and has_voted (#28808)
These fields are often used when serializing topics which may contain
multiple polls. On average, serializing a poll took 2+N queries where N
is the number of options. This change reduces the number of queries to
3, one for each field (Poll#voters_count, PollOption#voters_count and
Poll#has_voted?).
2024-09-10 18:41:08 +03:00
88e1690d86 FIX: poll preview list styling remove redundant bullets (#28592) 2024-09-10 10:54:59 +02:00
e6edd52047 DEV: Remove widget wrapper from poll plugin (#28666)
- Uses `helper.renderGlimmer` with GJS to render the `<Poll` component without any widgets

- Moves some logic into component, so that only `@post`, `@poll` and `@titleHTML` need to be passed into the component (no more 'attrs')

- Updates `modifyClass` calls to modern syntax

- Replaces observer in `Post` model with a native setter & tracked property

- Replaced Poll EmberObject instances with TrackedObject

- Updated component tests with new arguments

- Updated some tests to qunit-dom

- Fixed up core `repliesBelow` and `repliesAbove` logic to create post models properly. Previously it was passing 'transformed' versions of posts into the model, which doesn't make sense.
2024-09-04 09:38:22 +01:00