Previously the rendered locale was based on the current session's
locale. Now that we're routing requests via the CDN, we can't rely on
the user's session, and should instead include the locale name in the
URL. Also adds a `.js` suffix for parity with our other JS assets.
Currently LF is used, making the backup codes indistinguishable for Windows users.
Instead, use CRLF which is compatible for Windows as well as Linux and macOS.
https://meta.discourse.org/t/-/331940
CDNs are often configured to strip query params, which means that the
`?v=` parameter wasn't reaching the Rails app, and therefore the
cache-control header was not being set correctly. Having a 40 character
sha1 digest in the **path** is the approach we take for other similar
assets like stylesheets and theme-javascripts.
Also adds a spec for the fix in 573fbeef64f052decc47e740cbe01a3c298c20b5
Adds a description to highlight the need for sender to have correct
permissions when sending PM. Without the correct permissions the PM is
not sent and a message is added to the site logs.
Followup to 1b5e4b6b0fef9811839490f2ee3b9f31d5fbed3b
When running through a CDN in a multisite environment, the site hostname
needs to be included in the path or query or the URL so that the
'current db' can be set correctly by rails multisite. Without this, the
response will assume the default site in the cluster.
Updates the chat summary email to account for:
- unread mentions in category channels (same as before)
- unread direct messages (now excluding threads)
- unread watched thread replies (for both channels and DM channels)
We have also reduced the window from 1 week down to 1 day for all 3
criteria. The DM unreads query is now properly selecting the first
unread message within the window (rather than the first message
regardless of read status).
Previously, the SiteSetting::Update service allowed to update of a
single site setting. In the About controller, we were using the loop
through all settings -
https://github.com/discourse/discourse/blob/main/app/controllers/admin/config/about_controller.rb#L39
It is suboptimal because if the 3 first settings are saved and the
fourth is invalid, we will end with partially updated data.
Changing SiteSetting::Update to accept hash means that we will check
upfront if none of the settings are hidden or invalid and update all or
none.
Custom policies are used to report which settings are failing.
On chat setup we get the initial state of drafts for the current users,
we need to add them to the drafts manager, but we don't need to store
them again on the backend.
This commit adds a persist (boolean) parameter to the
`ChatDraftsManager.add` service which when set to true will only add the
draft on the frontend and not send it to the backend.
No test, as the behavior is already tested and unchanged, this is only a
performance improvement.
This has been a very hard to track and reproduce bug, but after a lot of
profiling I detected that a scroll was showing in the trace just after a
RemoveChild in div.sidebar-sections.
I suspect the performance of this is bad due to a difficulty to
reconciliate object identity and using key seems to help here as I was
not able to reproduce the bug after.
This PR reverts the removal of the import quote toolbar button that
happened in https://github.com/discourse/discourse/pull/30815.
It re-adds the previously existing implementation without changes.
This commit will allow plugin developers to enable/disable the topic op
likes data in serializer.
Usage:
```
register_modifier(:serialize_topic_op_likes_data) { |enabled| true }
```
This makes it clearer that admin css is compiled to a separate bundle.
This is a first step towards moving the 'admin' parts out of the main
mobile/desktop bundles.
Code/translations for the admin panel and wizard are not considered
sensitive, so there's no need for access control checks here. Once
they're removed, we can cache in NGINX and the CDN, and thereby improve
server and client-load performance.
This issue has been impossible to repro locally so far, but we have
reports of switching from one channel to another causing the sidebar to
scroll to the bottom.
Looking at the trace of events, calling `blurAndFocus` is the last
function call before it happens.
This totally separate SCSS and i18n compilation pipelines only existed
so that we could run `ember exam` in CI without starting Rails.
Now that our CI has such heavy caching of Ruby dependencies and database
migrations, the speed benefit of this is not worth the cost of
maintaining these separate pipelines.
Therefore, this commit removes that system, and updates CI to use
`bin/rake qunit:test`. That will start up a Rails server and proxy
stylesheet/locale requests to it. This strategy was already used for our
theme and plugin qunit test runs.
Previously, the only way to author js/hbs via the admin panel was to use
`<script>` tags. This strategy is not pretty, and doesn't provide access
to proper ES module imports or gjs `<template>` syntax.
Our recommendation for most themes is still that they should be authored
using a proper IDE, the `discourse_theme` CLI, and version-controlled
using git. However, we understand that this isn't a good fit for
everyone, and that there's still a place for simple
admin-panel-ui-authored themes.
This commit introduces a "JS" tab in the admin theme editor, which
corresponds to a file named
`discourse/api-initializers/theme-initializer.gjs` in the theme. This
means that everyone will be able to move towards the more modern
syntaxes, and away from the old `<script>` patterns.
This change allows you to add a reaction to the most recent message, by sending a reaction message.
A reaction message can be formatted as `+{emoji}` (eg, `+❤️`), or as `+{emoji_code}` (eg, `+❤️`).
This feature allows admins to find what they are
looking for in the admin interface via a search modal.
This replaces the admin sidebar filter
as the focus of the Ctrl+/ command, but the sidebar
filter can also still be used. Perhaps at some point
we may remove it or change the shortcut.
The search modal presents the following data for filtering:
* A list of all admin pages, the same as the sidebar,
except also showing "third level" pages like
"Email > Skipped"
* All site settings
* Themes
* Components
* Reports
Admins can also filter which types of items are shown in the modal,
for example hiding Settings if they know they are looking for a Page.
In this PR, I also have the following fixes:
* Site setting filters now clear when moving between
filtered site setting pages, previously it was super
sticky from Ember
* Many translations were moved around, instead of being
in various namespaces for the sidebar links and the admin
page titles and descriptions, now everything is under
`admin.config` namespace, this makes it way easier to reuse
this text for pages, search, and sidebar, and if you change it
in one place then it is changed everywhere.
---------
Co-authored-by: Ella <ella.estigoy@gmail.com>