Commit Graph

50212 Commits

Author SHA1 Message Date
Alan Guo Xiang Tan 003918d33f
DEV: Update copy for legacy navigation menu warning (#22656)
Follow-up to b719688887
2023-07-18 10:13:05 +08:00
Krzysztof Kotlarek b719688887
FIX: sometimes stuck of sidebar reorder (#22654)
When the mouse was moved quickly, the browser stayed in drag and drop mode and an additional click was required to exit drag and drop mode.
2023-07-18 11:56:43 +10:00
Alan Guo Xiang Tan 3da6759860
FEATURE: Add admin dashboard warning for `legacy` navigation menu (#22655)
Why this change?

The `legacy` navigation menu option for the `navigation_menu` site
setting will be removed shortly after the release of Discourse 3.1 in
the first beta release of Discourse 3.2. Therefore, we're adding an
admin dashboard warning to give sites on the `legacy` navigation menu a
heads up.
2023-07-18 09:41:38 +08:00
Martin Brennan b583872eed
DEV: Introduce enabled? API to hashtag data sources (#22632)
We need a nice way to only return some hashtag data
sources based on various site settings. This commit
adds an enabled? method that every hashtag data source
must implement. If this returns false the data source
will not be used at all for hashtag lookups or search.
2023-07-18 09:39:01 +10:00
Alan Guo Xiang Tan 1052ed9c3b
DEV: Fix flaky system test in `system/category_topics_spec.rb` (#22652)
Why was the test flaky?

The test relied on the fact that visiting a topic would marked its
post as unread. However, we did not actually stay on the topic long
enough in some cases for it to be considered read based on the logic in
our client side code.

This commit fixes the flakiness by ensuring that the post has actually
been read before navigating away.
2023-07-18 07:35:47 +08:00
Alan Guo Xiang Tan d3a7d335b9
DEV: Bump plugin-api.js to 1.7.0 (#22629)
What does this change do?

This commit removes the experimental label for a bunch of APIs that have
been used in production for quite some time at Discourse so that the
APIs can be released as part of Discourse 3.1
2023-07-18 07:29:55 +08:00
Alan Guo Xiang Tan beb91e1707
DEV: Skip two flaky system tests (#22651)
Why this change?

These tests have shown to be flaky and are being skipped for now while
we look into it.
2023-07-18 07:26:12 +08:00
Alan Guo Xiang Tan d9a7779811
DEV: Fix flaky core backend spec (#22650)
Why this change?

The user id in a fixture file was hardcoded to 666. Once we've
fabricated enough user objects until the sequence for `User#id` reaches
666, the specs in vanilla_body_parser_spec.rb will fail.

What is the fix here?

This commit increases the user id to a large integer which we will
likely never hit in the next 10-20 years.
2023-07-18 07:01:19 +08:00
dependabot[bot] e30b7776e7
Build(deps-dev): Bump terser from 5.19.0 to 5.19.1 in /app/assets/javascripts (#22649)
Bumps [terser](https://github.com/terser/terser) from 5.19.0 to 5.19.1.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.19.0...v5.19.1)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-18 06:32:09 +08:00
Roman Rizzi 77e5153350
UX: Point that topic summaries are generated by an AI (#22646) 2023-07-17 17:24:41 -03:00
Isaac Janzen bdaecc90c4
DEV: Convert group-default-notifications modal to component-based API (#22521)
This PR converts the `group-default-notifications` modal to make use of the new component-based API
2023-07-17 15:06:30 -05:00
Isaac Janzen 80a1709965
DEV: Convert history modal to component-based API (#22522)
This PR converts the `history` modal to make use of the new component-based API
2023-07-17 13:16:40 -05:00
Joffrey JAFFEUX e214fc38ed
FIX: in modal should check for body (#22642)
To decide to use flip behavior select-kit will check if it's located inside a modal as a modal will scroll if overflown, however, when locating the select-kit element in the footer or header this is not the case. This commit will deactivate `flip` modifier only when used inside modal body.
2023-07-17 17:39:01 +02:00
Rafael dos Santos Silva 3bde7ae433
FEATURE: Allow custom summaries for TL3 by default (#22641) 2023-07-17 11:46:27 -03:00
Joffrey JAFFEUX a982b6765f
FIX: allows to resize panels on tablets (#22640)
On tablets like iPad where we allow channel and thread to be on the same screen, it was not possible to resize the panels due to code being thought for mouse events. This commit should now correctly allow for this.

The "resizer" has also been made larger to simplify touching.

No test as it's hard to test on iPad and dragging events are also complex.
2023-07-17 15:11:51 +02:00
Joffrey JAFFEUX fe8d9b6b4e
FIX: allows to focus thread's composer on ipad (#22639)
On iOS we have a hack to prevent the viewport to move when focusing an input, however this code was targeting the textarea node through a global selector which is working fine on iOS as we only show one composer at a time but was failing on iPad as we show both channel and thread on the same screen. As a result `document.querySelector(".chat-composer__input")` was always targeting the first textarea on the screen which was the channel's composer, making it impossible to focus the thread's one.
2023-07-17 14:38:29 +02:00
David Battersby d44c9cf065
FIX: bind selector to event listener callback for lightbox (#22637)
Fixes an issue where this.selector value was not binded at the time of adding the event listener. Therefore when someone opens a chat channel that has images, the value of selector would change. I also moved the callback to a named function (rather than the default handleEvent).
2023-07-17 19:55:48 +08:00
chapoi 346ccfd7f5
UX: firefox fix for shorthand modal width (#22638) 2023-07-17 13:16:45 +02:00
chapoi e4deba0075
UX: size down unread indicators fror drawer/mobile (#22636) 2023-07-17 12:54:00 +02:00
Joffrey JAFFEUX a610c86302
DEV: adds `touchMove` support for widgets (#22635)
No tests as widgets are in maintenance mode until we can remove it, and this is also hard to test.
2023-07-17 12:49:00 +02:00
Joffrey JAFFEUX c042978778
DEV: fix flaky spec temporarily (#22633)
We have a fix coming tomorrow.
2023-07-17 09:45:31 +02:00
Martin Brennan b2ff00cc74
DEV: Fix bookmark system spec flaky (#22630)
1) Bookmarking posts and topics topic level bookmarks clears all topic bookmarks from the topic bookmark button if more than one post is bookmarked
     Failure/Error: expect(Bookmark.where(user: current_user).count).to eq(0)

       expected: 0
            got: 2
2023-07-17 15:34:11 +10:00
Alan Guo Xiang Tan 37fd05af4e
FIX: Editing tags in sidebar should show all tags visible to user (#22628)
Why this change?

Prior to this change, we would only return tags that are used in at
least one public topic. However, this is confusing for users because the
tag could be used in a restricted category and that is not considered a
"public" topic. Instead, we will just display all the tags in the edit
tags navigation modal as long as it is visible to the user.
2023-07-17 11:47:52 +08:00
Martin Brennan 07c3782e51
FEATURE: Show unread in sidebar for unread channel threads (#22342)
This commit makes it so that when the user has unread threads
for a channel we show a blue dot in the sidebar (or channel index
for mobile/drawer).

This blue dot is slightly different from the channel unread messages:

1. It will only show if the new thread messages were created since
   the user last viewed the channel
2. It will be cleared when the user views the channel, but the threads
   are still considered unread because we want the user to click into
   the thread list to view them

This necessitates a change to the current user serializer to also
include the unread thread overview, which is all unread threads
across all channels and their last reply date + time.
2023-07-17 13:00:49 +10:00
dependabot[bot] edc837eaf5
Build(deps-dev): Bump babel-import-util from 1.3.0 to 1.4.1 in /app/assets/javascripts (#22626)
Bumps [babel-import-util](https://github.com/ef4/babel-import-util) from 1.3.0 to 1.4.1.
- [Commits](https://github.com/ef4/babel-import-util/compare/v1.3.0...v1.4.1)

---
updated-dependencies:
- dependency-name: babel-import-util
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-17 08:58:46 +08:00
dependabot[bot] 9d8927c4f9
Build(deps-dev): Bump eslint from 8.44.0 to 8.45.0 in /app/assets/javascripts (#22625)
Bumps [eslint](https://github.com/eslint/eslint) from 8.44.0 to 8.45.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.44.0...v8.45.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-17 08:58:32 +08:00
Alan Guo Xiang Tan d916ff56b5
DEV: Use the main default session for main test assertion (#22627)
Why this change?

The test being changed in question has been flaky on our CI. However, we
are unable to view the screenshot of why it failed because
ActionDispatch will only take a screenshot of the default session upon
failure. At the same time, taking screenshot of all sessions
automatically upon failure is not possible via the official Capybara or
Rails APIs at the moment. Therefore, we're changing this system test to
avoid using two custom session and instead have the main assertion use
the default session such that any failures will provide us with a
screenshot.
2023-07-17 08:58:09 +08:00
Martin Brennan 6459922993
DEV: Move Bookmark modal/component to use d-modal (#22532)
c.f. https://meta.discourse.org/t/converting-modals-from-legacy-controllers-to-new-dmodal-component-api/268057

This also converts the Bookmark component to a Glimmer
component.
2023-07-17 10:14:17 +10:00
Blake Erickson 9e8010df8b
DEV: Use thumbnail url for wikimedia onebox image (#22620)
Wikimedia provides a thumbnail url for its images, so we should use that
for oneboxes instead of the full-size image. Because the size of the
  onebox image we display is quite small anyways the thumbnail wikimedia
  provides should suffice and will save bandwidth.

See: https://meta.discourse.org/t/264039
2023-07-14 12:20:18 -06:00
Dax74 2d6fdf86f0
Add discourse-ai plugin (#22619) 2023-07-14 17:29:42 +02:00
Roman Rizzi 0a65b9f098
UX: Disable summarize button while generating summary (#22618) 2023-07-14 12:19:51 -03:00
marstall 3e6e33df35
redirect to /login after account delete to prevent recreation of sso account (#22575)
* redirect to /login after account delete to prevent recreation of sso account

* after delete, redirect to /login if siteSettings.login_required
2023-07-14 11:13:45 -04:00
dependabot[bot] 8b985cbc88
Build(deps): Bump rubocop from 1.54.1 to 1.54.2 (#22608)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.54.1 to 1.54.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.54.1...v1.54.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-14 12:44:54 +02:00
dependabot[bot] 29425a3998
Build(deps-dev): Bump rswag-specs from 2.9.0 to 2.10.1 (#22607)
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.9.0 to 2.10.1.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.9.0...2.10.1)

---
updated-dependencies:
- dependency-name: rswag-specs
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-14 12:44:20 +02:00
Jan Cernik 402ac39fa2
FIX: Close modal after moving message to channel (#22601) 2023-07-14 12:22:18 +02:00
Joffrey JAFFEUX 6e95c1af3f
FIX: incorrect selector in system specs (#22615)
This could lead to flakey specs, and was invalid anyways.
2023-07-14 11:01:35 +02:00
Ted Johansson 7a53fb65da
FIX: Don't show admin warnings about deleted translation overrides (#22614)
We recently introduced this advice to admins when some translation overrides are outdated or using unknown interpolation keys:

However we missed the case where the original translation key has been renamed or altogether removed. When this happens they are no longer visible in the admin interface, leading to the confusing situation where we say there are outdated translations, but none are shown.

Because we don't explicitly handle this case, some deleted translations were incorrectly marked as having unknown interpolation keys. (This is because I18n.t will return a string like "Translation missing: foo", which obviously has no interpolation keys inside.)

This change adds an additional status, deprecated for TranslationOverride, and the job that checks them will check for this status first, taking precedence over invalid_interpolation_keys. Since the advice only checks for the outdated and invalid_interpolation_keys statuses, this fixes the problem.
2023-07-14 16:52:39 +08:00
mwaniki-wairungu bfad5607bd
DEV: Include details for Mailjet SMTP configs (#22613)
Added requisite SMTP parameters to be retrieved from the Mailjet Account page
2023-07-14 10:12:16 +03:00
Joffrey JAFFEUX ef21450be7
FIX: redirects to browse after removing last followed (#22563)
Prior to this change you might end up in a loop where removing a channel would redirect you to this channel and as we auto-follow opened direct message channels, you could never unfollow this last direct message channel.
2023-07-14 08:26:18 +02:00
Martin Brennan 10d155ea41
DEV: Further improve thread list query and add spec (#22610)
Followup to d7ef7b9c03,
this adds a spec to test the case where old threads are
still unread for the user and should show at the top regardless
of pagination, and fixes some issues/makes some slight refactors.
2023-07-14 16:08:35 +10:00
Martin Brennan 72bbc2fa8a
FIX: created_at datetime format inconsistencies in chat (#22611)
This commit attempts to fix an issue where we are ending
up with bad created_at date formats for last messages, which
is breaking the DM sort order and sometimes causing DM channels
to fall off the list, or show "Invalid date" on mobile.

I have not been able to consistently reproduce these issues
locally, however the serialzier for the channels index uses
MultiJSON.dump() and the Chat::Publisher uses .to_json, both of
which format created_at differently for messages.

The former is `2023-07-05T06:53:25.977Z` (iso8601).

The latter is `2023-07-14 03:59:22 UTC` (.to_s default).

Since we are doing comparison and sorting of these dates on the UI
we need consistent formatting for the JS Date parsers (and moment)
to deal with.

If the issue still occurs after this we can investigate further.
2023-07-14 16:05:01 +10:00
David Battersby ad365fad7a
FIX: lightbox setup blocked due to waiting for first image load (#22612)
The Problem
Clicking on a large image opens lightbox, however the new lightbox currently waits for the first image to finish loading before it finishes loading the lightbox UI correctly (ie. background color). This makes the visual experience feel broken.

Because open() is waiting for the image to load, it doesn't trigger the onOpen callback, which appends a .has-lightbox class to the html tag. The lightbox background color requires that css class to be set for the styles to be applied correctly.

The Solution
This PR prevents blocking when loading loading the first image (image that was clicked) within the lightbox, and therefore allows the css class to be appended to the html tag correctly and as a result fixing the styling issues.

The #setCurrentItem  function is async and awaits the loading of preloadItemImages already, so the image will load correctly when complete despite the rest of the UI loading in advance.
2023-07-14 14:02:06 +08:00
Faizaan Gagan 24ab2f42b0
FIX: add the required widget for admin-problems notification item (#22602) 2023-07-14 10:37:01 +05:30
Roman Rizzi dc547e39aa
FEATURE: Let users collapse the topic inline summary (#22604) 2023-07-13 18:21:50 -03:00
Mark Doerr ac6f2f0d96
DEV: Update /locales/server.en.yml text for max_consecutive_replies. (#22603) 2023-07-13 13:05:13 -07:00
Godfrey Chan 4d62c49e20
DEV: move raw handlebars to /raw-templates/ (#22574)
The primary motivation is to simplify `eagerLoadRawTemplateModules` which curently introspects the module dependencies (the `imports` at runtime). This is no longer supported in Embroider as the AMD shims do not have any dependencies (since it's managed internally with webpack).
2023-07-13 12:57:45 -05:00
Blake Erickson 380890d28b
DEV: Add a test for api scope routes (#22597)
Follow up to: 56e792d

Adds a test to check that there is an api scope for the t/external_id
route. Plus checks many other topic routes that should have scopes.
2023-07-13 10:48:22 -06:00
Joffrey JAFFEUX ee3bdab61d
FIX: ensures lightbox sends valid color to react-native (#22598)
Prior to this commit the `setSiteThemeColor` could mistakenly receive a color with a leading `#` which would cause an invalid color to be send to `postRNWebviewMessage` and would eventually cause a crash if we try to interpolate between this color and another.
2023-07-13 18:37:52 +02:00
Jamie Dunstan 56e792df9b
FEATURE: Extend the topics:read API scope to allow read by external_id (#22536)
Allow an API key created with `topics:read` API scope to get a topic by `external_id`
2023-07-13 09:02:32 -06:00
Joffrey JAFFEUX d7ef7b9c03
FIX: simplify channel threads lookup for pagination (#22596)
The previous query with subqueries was complicated to make right with pagination, this new query should be working correctly and is passing tests.
2023-07-13 16:44:22 +02:00