Commit Graph
68 Commits
Author SHA1 Message Date
Natalie Tay 22ce638ec3 FIX: Use subfolder-safe url for category in html view (#24595)
Use subfolder-safe url for category in html view
2023-11-28 19:08:14 +08:00
Natalie Tay a934804464 UX: Vertically align the svg in checkbox slider component (#24478) 2023-11-21 14:48:11 +08:00
Natalie Tay 2eb3f9fd44 DEV: Add an assertion for event triggered (#24259) 2023-11-07 11:59:40 +08:00
Natalie Tay 70be873b9c FIX: Allow category moderators to move topics to their categories (#20896) 2023-10-03 17:59:16 +08:00
Natalie Tay 20a882389a FIX: Correct error on add user modal (#23679) 2023-09-27 13:54:44 +08:00
Natalie Tay 187f9a9495 FIX: Replying to OP is a reply to the topic, not the post (#23380)
Clicking on the OP's Reply button twice results in the post being a reply to post number 1. This is a fix for that.
2023-09-04 17:06:41 +08:00
Natalie Tay bffdfbd11b DEV: Add method for page object (#23218) 2023-08-24 15:46:22 +08:00
Natalie Tay 4702df85b2 DEV: Add composer close method to composer (#23164) 2023-08-21 18:59:15 +08:00
Natalie Tay aa7917d533 DEV: Add some description to help with understanding flakey test failures (#23053) 2023-08-14 12:19:05 +08:00
Natalie Tay 173de8afe6 DEV: Add logging and rescue when user already exists and connecting via DiscourseConnect (#22833)
This is happening because despite the user already existing in the forum, the `SingleSignOnRecord` doesn't exist and "require_activation" is set on the provider, causing us to skip looking for the email, and resulting in us creating a new User then seeing Validation failed: Primary email has already been taken when DiscourseConnect is attempting to make a new account.
2023-07-28 02:53:33 +08:00
Natalie Tay 1ab1116cda FIX: Disable the previous revision button if it is the last revision (#22784)
We introduced a tiny bug #22522.

When viewing the last revision of a post, we need to disable the  button. This fixes the issue.
2023-07-26 00:44:57 +08:00
Natalie Tay 72bc3ae9ce DEV: Add some description to help with understanding flakey test failures (#22772) 2023-07-25 15:14:08 +08:00
Natalie Tay 64dec1368c DEV: Cleanup an old spec (#22503)
Introduced in #22297, now clear to remove since we don't have a habit of keeping migration specs.
2023-07-10 11:34:17 +08:00
Natalie Tay 1384ba5a4e FIX: Cater for polls that can have multiple votes per user (#22297)
Cater for polls that can have multiple votes per user.

This fixes an older UserMerge and migration which was intended to
de-duplicate poll votes but did not account for "multiple" type polls.
2023-06-27 18:58:16 +08:00
Natalie Tay 9afb9e6142 DEV: Update chat cooked quote spec (#22202)
A side effect of #21522 that went unnoticed.
2023-06-20 10:30:33 +08:00
Natalie Tay fcaefc9f2f FIX: De-duplicate poll vote on user merge (#22107)
When merging users, polls may error out if the source and target users have both voted on the same poll before. 😢 

There is no constraint on the `poll_votes` table either to support this. Ideally a composite primary key can be used `(poll_id, user_id)`, but alas there is no support yet, which is probably why it wasn't created in the first place.

This fix ensures that merging is successful by only keeping the target poll votes if duplicates exist.

This fix also runs a migration on older poll votes where failed merges would have caused a single user to have voted twice on a single poll. e.g. this weird edge case
2023-06-15 11:18:51 +08:00
Natalie Tay 3fe06bba9d FIX: Allow half-merged user to be accessed in admin UI (#22105) 2023-06-14 19:19:12 +08:00
Natalie Tay d2ef490e9a FIX: Hide delete button to invite as user are unable to delete anyway (#21884)
Moderators are not allowed to delete invites that don't belong to them
2023-06-06 12:24:19 +08:00
Natalie Tay 07061410d8 FIX: Anonymizing a user clears their user status too (#21673) 2023-05-22 13:18:09 +08:00
Natalie Tay 17603794b5 DEV: Reduce plugin system test parallel processors (#21466) 2023-05-10 15:43:41 +08:00
Natalie Tay 41bdf8cfcd DEV: Use BuildJet for some test jobs (#21404) 2023-05-10 10:39:27 +08:00
Natalie Tay 7aa2ede17f FIX: Update test limit for email domain (#21429) 2023-05-08 12:19:10 +08:00
Natalie Tay ccca2dbfe0 FIX: Quoted images should be lightboxed (#21332)
An older change about optimising images caused the selector that adds lightboxing not to apply on quoted images. This fixes that. The selector is now not applicable as optimisation occurs in a separate place.

This change allows quoted images to be opened in a lightbox.
2023-05-02 17:02:19 +08:00
Natalie Tay eb0836e133 UX: Add a warning that updating min_trust_level_for_user_api_key will disable users from using DiscourseHub (#21291) 2023-04-28 14:29:13 +08:00
Natalie Tay e1bc43aa31 Revert "DEV: Improve add_to_serializer include_* options (#21073)" (#21219)
This reverts commit 4895e76ef7.
2023-04-24 16:14:52 +08:00
Natalie Tay 068a36d354 UX: Improve error message when a topic cannot be moved due to category restrictions (#20900) 2023-03-31 02:18:57 +08:00
Natalie Tay 44b7706a2b UX: Skip applying link-type watched words to user custom fields (#20465)
We currently apply type: :link watched words to custom user fields. This makes the user card pretty ugly because we don't allow html / links there. Additionally, the admin UI also does not say that we apply this to custom user fields, but only words in posts.

So this PR is to remove the replacement of link-type watch words for custom user fields.
2023-03-01 10:43:34 +08:00
Natalie Tay 4855a2879c UX: Update badge icons (#20462) 2023-02-28 10:42:05 +08:00
Natalie Tay fda834d01c Revert "DEV: uses popperjs for positioning user and group card (#20063)" (#20072)
This reverts commit 335c3f4621.
2023-01-31 02:51:05 +08:00
Natalie Tay 58234246ff DEV: Remove elder from codebase and also update 'regular' to 'member' (#20065)
A while back the definition of TL was changed but many
areas in the codebase still use the term 'Regular user'
despite it having some implicit meaning (TL2).

See 20140905055251_rename_trust_level_badges.rb
2023-01-31 01:41:25 +08:00
Natalie TayandTed Johansson d5745d34c2 SECURITY: Limit the character count of group membership requests (#19993)
When creating a group membership request, there is no character
limit on the 'reason' field. This can be potentially be used by
an attacker to create enormous amount of data in the database.

Co-authored-by: Ted Johansson <ted@discourse.org>
2023-01-25 13:50:33 +02:00
Natalie TayandLoïc Guitaut f91ac52a22 SECURITY: Limit the length of drafts (#19989)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2023-01-25 13:50:21 +02:00
5eaf080239 SECURITY: Limit chat drafts length and preloaded count (#19987)
Only allow maximum of `50_000` characters for chat drafts. A hidden `max_chat_draft_length` setting can control this limit. A migration is also provided to delete any abusive draft in the database.

The number of drafts loaded on current user has also been limited and ordered by most recent update.

Note that spec files moved are not directly related to the fix.

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Régis Hanol <regis@hanol.fr>
2023-01-25 13:50:10 +02:00
Natalie Tay d914ea8366 FIX: Show topic titles in deleted-posts (#19610)
Show topic titles in deleted-posts
2022-12-28 16:07:06 +08:00
Natalie Tay 0ee050e208 DEV: Add helpers for system testing in plugins (#19421)
Add helpers for system testing in plugins
2022-12-16 18:25:31 +08:00
Natalie Tay d2c5c65e29 DEV: Remove unused i18n keys (#19312) 2022-12-05 22:01:54 +08:00
Natalie Tay 09b7433167 DEV: Add more page objects (#18972) 2022-11-11 17:44:40 +08:00
Natalie Tay ca33622216 DEV: Add category page object for plugin tests (#18971)
Add category page object for plugin tests
2022-11-10 21:00:12 +08:00
Natalie Tay 612ab8710a DEV: Give em plugins the green tick (#18836) 2022-11-03 11:41:25 +08:00
Natalie Tay 5e4bad0d8f FIX: Evaluate all callbacks rather than override them (#18788) 2022-10-31 10:13:56 +08:00
Natalie Tay 4b6a5f08fa FIX: Allow users already in automatic groups to log in (#18771) 2022-10-27 14:59:27 +08:00
Natalie Tay 1631394826 FEATURE: Show relative time when date is omitted (#18547) 2022-10-12 11:23:34 +08:00
Natalie Tay e391f71c04 FIX: Determining local date same range is erroring when there is no date (#18509) 2022-10-07 21:07:27 +08:00
Natalie Tay 7d8cda9858 FEATURE: Omit showing day when 'to' day is same as 'from' day (#18500)
Essentially,

Saturday at 2:50 PM -> Saturday at 4:38 PM becomes
Saturday at 2:50 PM -> 4:38 PM (Singapore)

Also, the displayed dates are shortened when the standalone date
is within two days. So despite the 'from' and 'to' date being the
same day, it may show 'Saturday' for 'from', and the specific date
for the 'to'. This corrects the behaviour.

(so if the current date and time is Thursday 5PM, the 'from' date
below is within 2 days, but the 'to' date is not)
Saturday at 2:50 PM -> 8 October 2022 at 9:38 PM becomes
Saturday at 2:50 PM -> 9:38 PM
2022-10-07 09:39:41 +08:00
Natalie Tay 70258232f5 DEV: Add tests for review-index route (#18415)
Add tests for review-index route
2022-10-05 12:39:35 +08:00
Natalie Tay 02e148cbde Version bump to v2.9.0.beta6 (#17283)
Needed for https://meta.discourse.org/t/unable-to-find-discourse-version-2-9-0-beta6/231511
2022-06-30 12:25:44 +03:00
Natalie Tay ff77ad7ac0 UX: Change copy for user-selector placeholder (#17260) 2022-06-28 19:01:16 +08:00
Natalie Tay 337cacc7bf DEV: Unflak-ify tests and make them more robust (#16659) 2022-05-06 11:53:23 +08:00
Natalie Tay 8c8b646a59 FIX: Prevent admin theme settings from blowing up (#16653) 2022-05-05 20:20:59 +08:00
Natalie Tay 34fba417f1 FIX: Show dismiss all modal in user-notifications page (#16491)
Earlier on when https://github.com/discourse/discourse/pull/14935 was implemented, the "Dismiss all" button in /user-notifications was not catered for. Now, it is!
2022-04-18 22:32:39 +08:00
Natalie Tay 23a8341b28 FEATURE: Validate domain settings for blocked_onebox_domain only (#15754)
We want to prevent the user from adding ? or * minimally
when setting domains in sitesettings
2022-02-03 11:26:53 +08:00
Natalie Tay aac9f43038 Only block domains at the final destination (#15689)
In an earlier PR, we decided that we only want to block a domain if 
the blocked domain in the SiteSetting is the final destination (/t/59305). That 
PR used `FinalDestination#get`. `resolve` however is used several places
 but blocks domains along the redirect chain when certain options are provided.

This commit changes the default options for `resolve` to not do that. Existing
users of `FinalDestination#resolve` are
- `Oneboxer#external_onebox`
- our onebox helper `fetch_html_doc`, which is used in amazon, standard embed 
and youtube
  - these folks already go through `Oneboxer#external_onebox` which already
  blocks correctly
2022-01-31 15:35:12 +08:00
Natalie Tay f5ea00c73f FIX: Respect blocked domains list when redirecting (#15656)
Our previous implementation used a simple `blocked_domain_array.include?(hostname)`
so some values were not matching. Additionally, in some configurations like ours, we'd used
"cat.*.dog.com" with the assumption we'd support globbing.

This change implicitly allows globbing by blocking "http://a.b.com" if "b.com" is a blocked 
domain but does not actively do anything for "*".

An upcoming change might include frontend validation for values that can be inserted.
2022-01-20 14:12:34 +08:00
Natalie Tay 3050fe893b DEV: Quick fix to flaky test (#15644)
We know that the real problem has got to do with cloaking (/t/10298), but while we find out precisely why, here's a quick fix.

Similar to #15627
2022-01-19 11:23:35 +08:00
Natalie Tay f2902d3830 FIX: Attempt to fix flaky test by using a shorter topic (#15627)
As part of /t/10298, try to remove the first flaky test in the list.

One finding is that the /t/280 topic has a very long post stream, so that may have caused some delay when rendering the topic. One way is to wait for the first expected element to load, but that doesn't scale well given how many waits we will need to add. So I chose to render a shorter topic instead.
2022-01-18 19:22:49 +08:00
Natalie Tay 2bf3f6d549 DEV: Remove duplicate key in fixture (#15625) 2022-01-18 16:42:53 +08:00
Natalie Tay dd3ed27930 DEV: Allow utility class domFromString to take in strings with multiple top level elements (#15548)
Previously only `<div>one top element</div>` was allowed because we use `firstChild` instead of `children`.
We also want `<div>one</div><div>two</div>` to work with this method.
2022-01-12 19:49:24 +08:00
Natalie Tay 9fd1a00eef DEV: Remove customer flair from being an official plugin (#15315) 2021-12-15 22:30:50 +08:00
Natalie Tay 77781f9a11 FEATURE: Extend plugin API to add multiple poster icons (#15311) 2021-12-15 18:09:26 +08:00
Natalie Tay 0f598ca51e SECURITY: Only show tags to users with permission (#15148) 2021-12-01 10:26:56 +08:00
Natalie Tay 4c46c7e334 DEV: Remove xlink hrefs (#15059) 2021-11-25 15:22:43 +11:00
Natalie Tay adf6498fe2 FEATURE: Show browser search tip when discourse search shows up in a topic (#15055) 2021-11-23 13:11:17 +08:00
Natalie Tay 340901c913 DEV: Add if a user is using an Apple device in widget capabilities (#15021)
* Consolidate device capability sniffing in caps
2021-11-23 11:21:31 +08:00
Natalie Tay 9015183942 Always show input when editing text by removing hover (#15034) 2021-11-22 10:23:42 +08:00
Natalie Tay d46e450733 Refine dismiss notification confirmation (#15017) 2021-11-22 09:11:24 +08:00
Natalie Tay da9a9a8e65 FIX: Add a confirm and cancel button when editing alt text (#15003) 2021-11-19 10:57:09 +08:00
Natalie Tay c61d47e6f4 FEATURE: Show a confirmation modal when "Dismiss all" would dismiss an important notification (#14935)
* Show a confirmation when dismiss all will dismiss an important notification
2021-11-17 09:44:30 +08:00
Natalie Tay 0b495e9ad4 FEATURE: Allow users to edit alt text from the image preview in the editor (#14480) 2021-11-09 14:34:09 +08:00