600 Commits

Author SHA1 Message Date
Nat
8397f62d3b
lint 2025-06-27 12:31:13 +08:00
Nat
03982f9c8a
emptystate 2025-06-27 12:16:34 +08:00
Nat
3c103b843c
controller test 2025-06-27 11:31:29 +08:00
Nat
ec76a37e9f
FIX: Use SolvedTopics to list posts in /activity/solved instead of user actions 2025-06-26 17:29:32 +08:00
Discourse Translator Bot
cee0ffc199
Update translations (#375) 2025-06-24 16:29:51 +02:00
dependabot[bot]
adba4d9d6e
Bump rack from 3.1.12 to 3.1.16 (#371)
Bumps [rack](https://github.com/rack/rack) from 3.1.12 to 3.1.16.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/v3.1.12...v3.1.16)

---
updated-dependencies:
- dependency-name: rack
  dependency-version: 3.1.16
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-21 18:00:04 +02:00
Discourse Translator Bot
03804e1065
Update translations (#373) 2025-06-17 23:08:17 +02:00
Natalie Tay
4d20d83374
FIX: User directory for solutions should update when value changes from positive value to zero (#372)
# bug
If John created a post which is a solution in March, the user directory would show that John solution = 1.
In April, if John has not solved a topic, he would still have solution = 1 in the user directory.

# fix
reset solutions to 0 before updating
2025-06-11 10:46:36 +08:00
Jarek Radosz
94f0c5a315
DEV: Update linting config and run gjs-codemod (#370) 2025-06-05 11:40:00 +01:00
zhanfengzeng
a7bc394bdc
FEATURE: apply plugin modifier for answers controller rate limiting (#369) 2025-05-22 11:07:07 -05:00
David Taylor
ba3d4276ee
DEV: Fix linting violations (#367) 2025-05-16 13:24:01 +01:00
Sérgio Saquetim
8e72136f54
DEV: Add compatibility with the Glimmer Post Stream (#363) 2025-05-05 15:12:39 -03:00
David Taylor
ae01ad30c3
DEV: Remove legacy topic-list code (#362) 2025-04-14 14:38:48 +01:00
Loïc Guitaut
4f0234f5be
DEV: Add system spec to check core features are working fine (#357) 2025-04-09 14:27:30 +02:00
Natalie Tay
539938ba59
FIX: Solutions directory item was using post creation instead of solved creation (#361)
Earlier on in the migration, the update of the user directory query was erroneously switched to use post creation date instead of the date the post was solved.

This commit fixes that.
2025-04-09 14:14:38 +08:00
Natalie Tay
6e12858bde
FIX: Accepting another answer does not commit (#360)
When an answer already exists, clicking " Solution" on another post works, but does not commit.

This commit fixes that and also adds a test, and a transaction around accepting a solution (deleting the topic timer, previous user action, etc).
2025-04-07 11:42:36 +08:00
Natalie Tay
24d819a7d6
FIX: 500 due to absent module (#359)
The class got refactored and slapped with a module, but the usage did not follow through.
2025-04-04 17:24:25 +08:00
Natalie Tay
37003f91ef
FIX: Exclude deleted topics and posts as solution in user summary (#358)
Follow up to #352

The user summary solutions count is more than it should be because of deleted topics and posts.
2025-04-04 16:43:00 +08:00
Discourse Translator Bot
e2a09417a2
Update translations (#355) 2025-04-03 00:05:10 +02:00
Sérgio Saquetim
b128e65ae5
DEV: Remove the legacy widget post menu code (#351) 2025-04-02 22:31:40 +01:00
David Taylor
390141297f
DEV: Drop widget post-menu test (#356)
In preparation for https://github.com/discourse/discourse/pull/31211
2025-04-01 15:23:34 +01:00
David Taylor
aede1c30cf
DEV: Update selector in test (#354)
Preparation for https://github.com/discourse/discourse/pull/32082

Followup to fc2d1a290c31eb6f415b346f8dcd01e79fad8041
2025-03-31 20:58:59 +01:00
David Taylor
fc2d1a290c
DEV: Add class to solve topic-status (#353)
Preparing for https://github.com/discourse/discourse/pull/32082, which switches core to use the modern TopicStatus component everywhere
2025-03-31 16:25:12 +01:00
Natalie Tay
be5798f6d8
FIX: Standardise the definition of what a solution is (#352)
There are three locations where a user's solution query is defined
- user summary
- user card
- user directory

This PR updates the queries to use data from the new `SolvedTopics` table instead of the `UserActions` table. And adds testssssss
2025-03-28 09:49:02 +08:00
Natalie Tay
9e9ac2862c
FIX: Some solved topics have no answers (#350)
As part of https://github.com/discourse/discourse-solved/pull/342, some discrepancies in the old implementation resulted in solved topics linking to posts that do not exist (dangling custom field value). Causing us to see the following when there are no `answer_post`

```
NoMethodError (undefined method `user' for nil)
```

This PR prevents the error.
2025-03-27 01:15:15 +08:00
chapoi
ad2555f1e0
UX: fix misalignment for non-admin and anon + move to variable use (#349) 2025-03-26 16:49:47 +01:00
Natalie Tay
1805184cde
FIX: Multiple topics may have the same post as its solution (#348)
We are seeing some errors when migrating and adding indexes on `answer_post_id`.

```
#<StandardError:"An error has occurred, all later migrations canceled:\n\nPG::UniqueViolation: ERROR:  could not create unique index \"index_discourse_solved_solved_topics_on_answer_post_id\"\nDETAIL:  Key (answer_post_id)=(13006) is duplicated.\n">
```

This PR modifies the earlier migration, and also adds one before the addition of indexes to remove duplicates.
2025-03-26 22:21:32 +08:00
Natalie Tay
a8a3554cec
FEATURE: Add setting to show who marked as solved (#347)
This commit adds the site setting `SiteSetting.show_who_marked_solved` and also the following tooltip to answer posts.
2025-03-26 11:43:22 +08:00
Natalie Tay
6b07af89da
UX: Better alignment and gaps for marked solved by (#346) 2025-03-26 02:21:36 +08:00
Discourse Translator Bot
d88ea600b9
Update translations (#345) 2025-03-25 17:23:18 +01:00
Natalie Tay
5a0c875885
FEATURE: Show 'marked solved by' in OP when topic is solved (#343)
Depends on: https://github.com/discourse/discourse-solved/pull/342

This feature adds the "Marked solved as" information to the solved post appended to OP.

Originally, I had moved the widget usage to a [component](39baa0be4a/assets/javascripts/discourse/components/solved-post.gjs), but due to "cooking quotes", after some internal discussion (t/95318/25) we will stick to widgets for now as the post-stream gets modernized.
2025-03-25 17:14:02 +08:00
Natalie Tay
e0a579e69e
FIX: Migration was only done for first batch (#344)
https://github.com/discourse/discourse-solved/pull/342 was deployed and observed to only have 5000 (batch size) migrated. This is an error in migration where the ids had a gap between the batch.

This PR changes the migration to just loop through all topic custom fields with each loop increasing by batch size.
2025-03-25 17:06:22 +08:00
Natalie Tay
55c1eb4d60
DEV: Move solved custom fields into a table (#342)
Related: 
- https://github.com/discourse/discourse-solved/pull/309
- https://github.com/discourse/discourse-solved/pull/341

Requires:
- https://github.com/discourse/discourse/pull/31954

This commit converts all use of post and topic custom fields into a dedicated table:
- migration for copying custom field into table
- swap app usage of custom fields to table

This commit does not attempt to fix issues or optimise, and does not delete old data from custom fields _yet_.
2025-03-25 14:51:32 +08:00
Natalie Tay
e82c6ae1ca
DEV: Autoload and segregate features to prep for migration (#341)
This commit autoloads plugin files, and also extracts features into their own modules.
- `plugin.rb` is smaller
- external plugins like discourse-automation and discourse-assign have their own entrypoints
- solved filters as well
2025-03-21 11:45:19 +08:00
Jarek Radosz
4e3521fd25
DEV: Update linting (#340) 2025-03-17 12:00:55 +00:00
Jarek Radosz
17d0f09ed1
DEV: Update license (#337) 2025-02-24 11:24:22 +08:00
dependabot[bot]
f7bbffa617
Bump rack from 3.0.11 to 3.0.12 (#335)
Bumps [rack](https://github.com/rack/rack) from 3.0.11 to 3.0.12.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/commits/v3.0.12)

---
updated-dependencies:
- dependency-name: rack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-13 23:31:36 +00:00
Régis Hanol
956c0443f6
FIX: don't allow or count solutions in PMs (#334)
* FIX: don't allow or count solutions in PMs

Pretty straightforward, this ensures we don't allow users to mark a post
as a solution in a PM.

This also ensures we don't count solutions in topics that were converted
to a PM.

Internal ref t/146766
2025-02-11 14:59:50 +01:00
David Taylor
3efcd3722a
DEV: Bump dependencies and fix linting (#333) 2025-02-06 17:42:05 +01:00
David Taylor
9a00198d4b
DEV: Pin version for Discourse <3.5.0.beta1-dev (#332) 2025-02-05 20:17:21 +01:00
Roman Rizzi
5450a5ef4e
DEV: Promote historical post-deploy migrations (#331) 2025-01-24 11:48:56 -03:00
Jarek Radosz
c8ac2c7002
DEV: Display unsolved icon only on the topic list (#330)
…in the new topic-status implementation (using the next `@context` from https://github.com/discourse/discourse/pull/30940)

This roughly matches the old implementation (but there it was displayed in some places but not in others mostly because of implementation details/bugs)
2025-01-23 04:21:46 +01:00
Jarek Radosz
c929f49f3d
FIX: Use both possible *_answer attributes (#329)
…and simplify other conditions (`can_have_answer` is true only if `solved_enabled` and `empty_box_on_unsolved` are also true)
2025-01-23 03:53:48 +01:00
Discourse Translator Bot
e6cda87505
Update translations (#328) 2025-01-14 16:20:09 +01:00
Jarek Radosz
a73bfa228e
DEV: Add gjs implementation of solved topic status (#327) 2025-01-14 13:38:48 +01:00
Discourse Translator Bot
3f724bf311
Update translations (#326) 2025-01-03 14:02:07 +01:00
Kelv
3443539725
DEV: Update more deprecated Font Awesome icon names (#325)
* DEV: Update more deprecated Font Awesome icon names

* update to square-check


Co-authored-by: Jarek Radosz <jradosz@gmail.com>

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-12-06 07:16:13 +08:00
Kelv
0a8df2c7f9
remove duplicate version tag in discourse-compatibility (#324) 2024-12-04 11:24:04 +08:00
Kelv
ac0c938a35
DEV: Update deprecated Font Awesome icon names (#323) 2024-12-04 02:36:24 +01:00
Jarek Radosz
024d9dd70f
DEV: Use topic-list-item-class transformer (#321)
…to replace a deprecated topic-list-item customization
2024-12-03 15:09:43 +01:00