Commit Graph

26236 Commits

Author SHA1 Message Date
e21c640a3c DEV: Add polymorphic bookmarkable columns (#15454)
We are planning on attaching bookmarks to more and
more other models, so it makes sense to make a polymorphic
relationship to handle this. This commit adds the new
columns and backfills them in the bookmark table, and
makes sure that any new bookmark changes fill in the columns
via DB triggers.

This way we can gradually change the frontend and backend
to use these new columns, and eventually delete the
old post_id and for_topic columns in `bookmarks`.
2022-01-06 08:56:05 +10:00
e6ab8f5b71 DEV: Re-use main app registry for raw HBS view lookups (#15456)
da6edc1 introduced the `lookupView` method, which initialized a fresh resolver, and used it to directly look up raw-views (with no caching). This worked well, but was not a clean solution. It required initializing an entirely new resolver, and did not have any caching.

This commit updates the `helperContext` to include access to the registry, and uses it to perform raw-view lookups. As well as re-using the registry, this also means we're making use of the resolver's built-in cache.

I haven't been able to measure any noticeable performance impact from this change, but there is certainly less work being done, so it may be beneficial on older devices.

Co-authored-by: Ayke Halder <rr-it@users.noreply.github.com>
2022-01-05 22:22:13 +00:00
6e0e6014d1 FIX: When loading more topics, showFooter was not updated properly 2022-01-05 15:12:40 -05:00
e04069cf0d FIX: Jittery topic progress on some window sizes (#15462) 2022-01-05 14:09:25 -05:00
c5fd8c42db DEV: Fix methods removed in Ruby 3.2 (#15459)
* File.exists? is deprecated and removed in Ruby 3.2 in favor of
File.exist?
* Dir.exists? is deprecated and removed in Ruby 3.2 in favor of
Dir.exist?
2022-01-05 18:45:08 +01:00
692ba188bf DEV: migrate routes to the new @action pattern (#15435)
After this fix we have only two routes that use the old "actions:" pattern:
- route:application
- route:discourse

I'll migrate them soon.
2022-01-05 16:08:06 +04:00
4134c9b478 FIX: use font-down 2022-01-05 10:25:39 +08:00
719d052ead FIX: smaller pencil icon for edit tags
Pencil icon should be same size as in edit topic title
2022-01-05 10:25:39 +08:00
099b679fc5 DEV: Clean up old bookmark code (#15455)
The rake task deleted here was added back in Feb 2020
when bookmarks were first converted from PostAction
records, it is no longer needed. The ignored columns
were removed in ed83d7573e9011de1cc5f4a95728ca709d1b7106.
2022-01-05 10:02:02 +10:00
a717c307ce FIX: Small adjustments to topic progress position on desktop (#15447) 2022-01-04 18:28:26 -05:00
1f1aa6a0d8 FEATURE: Catch decorateCooked errors from themes/plugins (#15450)
If a theme/plugin raises an error while decorating post content, the decorator will be skipped, and the error reported on the console. Additionally, administrators will be shown a red warning at the top of the screen.

This commit refactors and re-uses some of the logic from the theme-initializer-error-reporting logic. In future, new error reports can be added by doing something like:

```
document.dispatchEvent(
  new CustomEvent("discourse-error", {
    detail: { messageKey: "some.translation.key", error },
  })
);
```
2022-01-04 21:59:52 +00:00
6c5522db77 DEV: Remove JQuery from app.js (#15449) 2022-01-04 19:56:27 +00:00
c4e8ba3965 UX: post action spacing refactor & consistency (#15403) 2022-01-04 09:44:54 -05:00
be599513e3 FEATURE: use raster image and autofill in 2FA input (#15429)
- switches to a raster image QR code so it can be long-pressed (or right
clicked) and added to iCloud keychain
- adds `autocomplete="one-time-code"` to the 2FA input for better
discoverability
2022-01-04 15:31:46 +11:00
ed83d7573e FIX: Tone down admin dashboard critical problem messaging (#15442)
Keep the title the same as it used to be and only
show the exclamation icon on the critical problems in
the list.
2022-01-04 13:00:58 +10:00
b22450c7a8 DEV: Drop old bookmark columns (#15405)
As per 22208836c5
these are no longer needed, a follow up commit will remove the ignored
columns.
2022-01-04 11:19:27 +10:00
20fe5eceb8 FEATURE: Scheduled group email credential problem check (#15396)
This commit adds a check that runs regularly as per
2d68e5d942fa9312655d3d5abacf15d8a9fca948 which tests the
credentials of groups with SMTP or IMAP enabled. If any issues
are found with those credentials a high priority problem is added to the
admin dashboard.

This commit also formats the admin dashboard differently if
there are high priority problems, bringing them to the top of
the list and highlighting them.

The problem will be cleared if the issue is fixed before the next
problem check, or if the group's settings are updated with a valid
credential.
2022-01-04 10:14:33 +10:00
61bb0df3f6 FEATURE: Allow topic pin toggle when header is docked (#15438)
Meta topic: https://meta.discourse.org/t/cant-pin-unpin-topic-from-the-title/213444?u=osama.

I know there is an inconsistency between the category of the linked topic (#bug) and the title prefix of this PR, but I really couldn't find anything in the code base that suggested this ever worked before, so I'm categorizing this PR as a feature.
2022-01-03 15:21:06 +03:00
702685b6a0 SECURITY: only show user suggestions with regular post (#15436) 2022-01-03 13:37:40 +05:30
7fdb2944b9 DEV: Allow ember server --environment production to be used (#15431)
Running in production mode is useful when doing performance-sensitive work.

- Set the `exportApplicationGlobal` flag, so we get the `Discourse` global in production mode. It defaults to only adding the global in development mode. Note that, when generating ember-cli assets via rails, we set this in `ApplicationHelper#discourse_config_environment`.

- Disable SRI - Ember CLI adds this to index.html when in production mode. We don't use SRI in production, so disable here to match.

- Refactor the `AssetRev` logic in `ember-cli-build.js`, so that our custom bundle hashes are find/replaced into index.html. Without this change, our custom bundles (e.g. `start-discourse.js`) remain without their hash in `index.html`, and do not function.

  I have confirmed that the only diff in the `/dist` out following this change is to the `index.html` file. All other filenames and contents remain identical.
2021-12-31 12:26:23 +00:00
23b75d8a2b FEATURE: Before consolidation callbacks. (#15428)
You can add callbacks that get called before updating an already consolidated notification or creating a consolidated one.

Instances of this rule can add callbacks to access the old notifications about to be destroyed or the consolidated one and add additional data inside the data hash versus having to execute extra queries when adding this logic inside the `set_mutations` block.
2021-12-30 15:40:16 -03:00
Joe
20de49c872 check for code-blocks before loading highlight-js 2021-12-30 12:44:22 -05:00
Joe
c5c216563e remove deprecated jQuery workaround 2021-12-30 12:44:22 -05:00
05eaedc810 DEV: revert linting workaround for emoji picker keydown action (#15424) 2021-12-30 12:39:21 -05:00
bbca25e875 fix flair misalignment (#15425) 2021-12-29 14:58:10 -06:00
879e35195a DEV: Small refactor to header offset (#15421)
Centralizes calculations in a helper under the site header component.

This also reverts a small CSS change to the composer: since ac79c5ef,
the composer height was not including the grippie, which means that the
composer height was off by 11 pixels, and the topic progress widget was
sometimes being displayed cut off by 11 pixels.
2021-12-29 11:03:21 -05:00
108c8302fb FEATURE: Automatic admin editor dark mode (#15419) 2021-12-29 11:02:37 -05:00
f6db99b56a UX: improved invite accept page layout (#15418) 2021-12-29 09:12:18 +05:30
8e6988163f FIX: Don't allow NULL values for notification_level in category_users (#15407) 2021-12-29 09:19:39 +11:00
91a816e788 DEV: Add composer-open class to body element when compsoer is open (#15420) 2021-12-28 15:25:53 -06:00
312c417366 DEV: Minor topic timeline refactor (#15357) 2021-12-28 12:01:20 -05:00
Joe
e09742aa69 FIX: improve the way magnific popup is loaded (#15348) 2021-12-28 11:48:03 -05:00
b75cbec4b6 FEATURE: allow sending message via a link to multiple users (#15412)
https://meta.discourse.org/t/possible-to-compose-pre-filled-multi-user-private-message-via-url/78020
2021-12-28 06:35:22 +05:30
e005e3f153 DEV: Create post actions without creating a notification and store custom data. (#15397)
I plan to use this in an upcoming discourse-reactions PR, where I want to like a post without notifying the user, so I can instead create a reaction notification.

Additionally, we decouple the a11y attributes from the icon itself, which will let us extend the widget's icon without losing them.
2021-12-27 11:25:37 -03:00
0b34d5ac6c UX: Maximize the preview space in composer (#15188)
A follow-up to #15117 and #15141. Applies the previous changes to PM-specific fields, makes the preview area take the all the available height of the composer, and unifies more spacing between composer elements.
2021-12-24 12:38:33 +01:00
1ad47030fe REFACTOR: Use a consolidation rule for collapsing likes. (#15393)
This PR moves the behavior from the PostAlerter. We delete an existing liked notification and set the `username2` attribute to the previous `display_username`. We repeat this process unless the last one is old enough or it's not in the most recent ones.
2021-12-23 09:44:03 -03:00
435562cc70 FIX: Uploads were broken in old Safari (#15391)
Blob.prototype.arrayBuffer is Safari 14 onwards, so we can check to see if this exists and just skip the checksumming if not.
2021-12-23 08:16:51 +10:00
abb57c350d FIX: Save draftSequence when it is 0 (#15394)
The first draftSequence value is 0 and that was not recognized as a
valid value by the client.
2021-12-22 22:01:28 +02:00
28400f1cbe FIX: Predict draftSequence on draft save (#15390)
The new draft sequence is returned after the draft is saved and usually
it is the old draft sequence plus one and this way the new draft
sequence can be predicted.

Sometimes drafts are saved at odd times or the request is slower than
usual which can create a race condition. This prediction can fix this
problem.
2021-12-22 17:17:32 +02:00
b0dd1b1200 DEV: correctly notify property changes of emoji store (#15389) 2021-12-22 10:59:41 +01:00
667a8a63b3 DEV: Drop jQuery file uploader and old upload components (#15376)
This commit removes jQuery file uploader from Discourse,
completing the transition to Uppy. The image-uploader
and UploadMixin components are also removed in this commit
as they have already been replaced and are the only things
using jQuery file upload.

            .-'~~~`-.
          .'         `.
          |  R  I  P  |
          |   jquery  |
          |    file   |
          |   upload  |
          |           |
        \\| 2013-2021 |//
        -----------------
2021-12-22 08:59:44 +10:00
72ad5bf8bd FIX: SiteSetting.title was being polluted in StaticController (#15385)
Regressed in #15324
2021-12-21 20:51:18 +01:00
96982ca2bc FIX: gives composer options to post:highlight trigger (#15384)
This change allows to prevent page jump, when jump is prevented, due to highlightPost causing a `focus()`.
2021-12-21 19:53:07 +01:00
0192efb37b FIX: Remove length constraint of fancy_title in topics (#15381)
The `fancy_title` column in the `topics` table currently has a constraint that limits the column to 400 characters. We need to remove that constraint because it causes some automatic topics/PMs from the system to fail when using Discourse in locales that need more than 400 characters to the translate the content of those automatic messages.

Internal ticket: t58030.
2021-12-21 21:24:23 +03:00
5a0e878a8a DEV: Add callback when search is empties in choose-topic (#15380) 2021-12-21 11:58:39 -06:00
f97c8ff0a6 DEV: add a container to the empty-state layout to simplify styling in themes (#15264) 2021-12-21 21:37:29 +04:00
c202252190 FEATURE: when suggesting usernames skip input that consist entirely of disallowed characters (#15368) 2021-12-21 21:13:05 +04:00
952bebc5a1 FIX: fallback to anonymous not user when suggesting usernames for anonymous users (#15354) 2021-12-21 21:09:55 +04:00
852dc85504 DEV: Add div around choose-topic results (#15379) 2021-12-21 08:54:40 -06:00
3ca1b17589 DEV: Change images-uploader to use Uppy (#15375)
Missed this one, it is only used for the selectable_avatars
site setting.
2021-12-21 15:53:44 +10:00