Commit Graph
601 Commits
Author SHA1 Message Date
Kris e4b4a97d9e DEV: re-enable and update empty state tests (#380) 2025-07-09 13:58:35 -04:00
Kris 1d038963fd TEMP: skip tests due to core change (#379) 2025-07-09 10:24:06 -04:00
Natalie Tay f96aceb5f4 FIX: Use SolvedTopics to list posts in /activity/solved instead of user actions (#376)
In https://github.com/discourse/discourse-solved/pull/342 we moved solutions away from topic_custom_fields into proper tables, with the tables as the proper source of truth to a topic's solution.

The user's /my/activity/solved route uses user_actions which is not accurate, and a user has reported a bug where their solution is not reflected there (user actions are not a good representation of what a topic's solution is). 

This commit introduces 
- a new route to get solutions, and is mindful `hide_user_profiles_from_public` and such settings
- also mindful of PMs and private categories
- a new template that makes use of the `<UserStream>` to load posts safely and avoid reimplementation
2025-07-02 16:56:12 +08:00
Natalie Tay 041b58eed1 FIX: Exclude the first post itself when checking if an existing solution from the user exists (#378)
This commit makes sure to exclude the first solution when checking for an existing solution and has better tests -- the existing test does not accept the post prior to making the check.
2025-07-02 11:45:14 +08:00
Natalie Tay 0350b46bda FIX: Check if user has existing solution despite trust_level=any for first accepted solution validator used in automation (#377)
There exists a bug in the following trigger (see screenshot) where if the user has an existing solution already, they will still pass validation for "first accepted solution" due to the trust level being "any".
2025-06-30 15:40:16 +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] <[email protected]>
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 fc2d1a290c
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