One can use it in a plugin to override the whole "login-required"
template without having to replace all the different (and smaller)
plugin outlets already available in that template.
Internal ref - t/154909
Follow up to 0ccf792b91
In the linked commit, I moved the `AdminConfigAreaCard` component out of the
admin bundle and into the main discourse bundle to make the new
`addCardToAdminThemesGrid` API method, introduced in the same commit, work
without breaking the site for non-staff users who don't get the admin
bundle.
However, there's a better way to go about this without forcing us to
move the component file to the main bundle which is to introduce a new
`PluginOutlet` since it effectively does the same thing as the
`addCardToAdminThemesGrid` API method and it's already a well
established pattern for letting plugins customize and add content to
Discourse pages.
At this point cooked could be null and checking if it's inside a small
action is useless and would generate an error which wouldn't break
anything but is something we want to avoid.
Improvements:
- When import Horizon theme, ensure that default color scheme is marked
as `user_selectable`
- Dark version of the theme is `user_selectable` as well
- When merge remote Horizon into system Horizon, also ensure that
default color scheme is marked as `user_selectable`
This commit adds a header with badges indicating why a reviewable was
created in the refreshed reviewable UI that is currently being hidden
behind the `reviewable_ui_refresh` site setting.
Co-authored-by: Gary <gary@pento.net>
`ReviewableClaimedTopic` has an `onClaim` arg, which is used by the calling components to locally mutate the value of `reviewable.claimed_by`.
This was being incorrectly mutated to a `User` model, when it needs to match the `ReviewableClaimedTopicSerializer` output.
In Horizon theme all paragraphs in welcome banner are hidden (for some
reason).
Adding exception for `.welcome-banner__subheader` subheader, if it is in
the DOM.
List of small changes for the system Horizon theme:
- Remove"Created by: system"
- Remove All Extra Files section
- Move translation to core
- Remove settings editor button
- Remove export button
Dropdown and multiselect components lack `InputTip`, which makes them
not show any reason when validation fails.
This commit also adds a new i18n message for select fields, after this
commit, if a multiselect or dropdown custom field required has no option
selected, it will display a `Please select a value for "XX" field`
validation error when the Signup button is clicked.
**Problem**
An error is showing up for staff members when trying to upload images
and `SiteSetting.authorized_extensions = ""` and
`SiteSetting.authorized_extensions_for_staff != ""` because
`this.currentUser` is not defined in the `UppyUploader` component
This commit adds plugin outlets throughout the themes and components admin pages to allow plugins to insert and replace various elements on those pages, and adds a plugin API to append custom cards to the themes grid at `/admin/config/customize/themes`.
A refactor has been done to move the `AdminConfigAreaCard` component out of the `admin/` bundle into the main/app bundle to make the plugin API work without breaking the site for non-staff users. If the component file stayed in the admin bundle, the plugin API class, which is in the main bundle, would fail to import from the component file in the admin bundle the required functions when normal users accessed the site because the admin bundle wouldn't be loaded for them.
Internal topic: t/156924.
This commit introduces an experimental `reviewable_ui_refresh` site
setting of `group_list` type. When a user is part of any group
configured in the site setting, the new reviewable UI will be shown to
the user.
Co-authored-by: Gary <gary@pento.net>
Adds support of an optional subheader to the core welcome banner.
Similarly to header it accepts `logged in` and `anonymous` copies.
---------
Co-authored-by: Martin Brennan <martin@discourse.org>
RFC example is:
```
List-Unsubscribe: <https://example.com/unsubscribe/opaquepart>
List-Unsubscribe-Post: List-Unsubscribe=One-Click
Resulting POST request
POST /unsubscribe/opaquepart HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 26
List-Unsubscribe=One-Click
```
This requires a few changes on our part:
1. CSRF skipping for this very specific POST request
2. Special handling to "guess" what users means on unsubscribe
We opt for the "maximum" amount of unsubscribing per strategy:
- digest - get rid of them all
- mailing list - stop all emails
- topic - stop watching category and topic
This passes a couple additional args to the `header-content__before`.
This is used by a private plugin, to append the sidebar hamburger back
in a specific case.
We want to add a hidden limit to the number of locales an admin can set
for localization. This is a safe limit to prevent excessive localization
(if each post can be localized to 10 locales, that's 10x the amount of
storage and tokens needed).
t/157677
Rake task to merge a single installation of Horizon into the system
Horizon.
What task do:
- Set Horizon as `experimental_system_themes` if not yet included;
- Set system Horizon as the default if manual Horizon was the default;
- Set the system Horizon as selectable if the manual Horizon was
selectable;
- Link components from the manual Horizon to the system Horizon;
- Update UserOptions `theme_id`, `color_scheme_id` and `dark_scheme_id`;
- Update the system Horizon color palette to match the manual Horizon
color palette;
- Move ThemeSettings from manual Horizon to system Horizon;
- Move ThemeTranslations from manual Horizon to system Horizon;
- Delete manual Horizon color schemes;
- Delete the manual Horizon.
---------
Co-authored-by: Martin Brennan <martin@discourse.org>
This commit adds a new modifier that plugins can hook into to add further
restriction to who can install themes and components via the admin UI. It
isn't possible to use this modifier to open up the theme installation
permissions to more than core allows, e.g. this modifier can't be used
to allow moderators to install themes on the site.
Internal topic: t/156924.
Followup d92de3e4d0
We have an ADMIN_NAV_MAP const that was being used in the admin sidebar
and the admin search to generate a list of links that the admin can
see and navigate to.
However, we were modifying this const, which led to inconsistent
behaviour between the admin sidebar and admin search, leading to
flaky tests.
This commit moves the access control of ADMIN_NAV_MAP into a new
service, and introduces a more structured way of adding/changing
links in the nav map that the sidebar and search can use directly.
This commit also removes old unused code from the admin sidebar
state manager used to store a custom admin nav map in localstorage.
Reported here:
https://meta.discourse.org/t/components-list-not-showing-all-components-after-deleting-one/371784
Deleting a component reloads the component list, but doesn't maintain
pagination if the admin loaded multiple pages of components... so you
can end up with only a partial list after delete.
This instead removes the component from the array without a reload, so
it maintains the current list state.