3086 Commits

Author SHA1 Message Date
Martin Brennan
f95464ba81
Revert "UX: Hide inner site settings sidebar if admin sidebar enabled (#31047)" (#31267)
This reverts commit 91e9c1c81343990d5ebbb3a3bb7c68ec4445d610.

After feedback, for now we are reverting this change. This is not
permanent, the settings sidebar will be removed again, after we:

* Visually group the settings the same way as the sidebar does
  on All Settings
* Add more settings pages to the main admin sidebar to cover the ~250
  settings not yet represented there
2025-02-11 12:47:40 +10:00
Ted Johansson
3d11e3ca10
DEV: Require at least one scope for API key granular mode (#31253)
Currently, if creating an API key in "granular" mode, and not selecting any scopes, a globally scoped API key is created. This can be surprising and is not ideal. Having a key with no scopes isn't useful in the first place, so this PR adds client- and server side validations to check that at least one scope is selected if using "granular" mode.
2025-02-10 13:22:08 +08:00
Ted Johansson
af43f6135e
FIX: Only include custom plugin config routes in tabs for old show page (#31213)
Same as #31192, but for plugins that are not yet converted to the new show page. 🙏
2025-02-06 10:03:01 +08:00
Penar Musaraj
b9d4c57f07
UX: Fix HTML showing in delete user button (#31201)
Also rewords it to clarify the action. And ensures both `delete` buttons
get the `btn-danger` class.
2025-02-05 16:28:10 -05:00
Joffrey JAFFEUX
4a7a9efbb9
FIX: correctly check for hasData in admin-report (#31197)
Using length is not working on javascript objects and this would always
be falsey.

```
const test = { foo: 1 };
test.length // undefined
```
2025-02-05 17:19:33 +01:00
Ted Johansson
bb12f8275d
DEV: Only include custom admin UIs in the plugins index tabs (#31192)
In the current admin index page, all plugins show up as tabs. This includes plugins with auto-generated config routes.

This changes the tabs to include only plugins with custom UIs.
2025-02-05 15:02:46 +08:00
David Taylor
50337a7595
DEV: Pin pnpm to v9 (#31158)
pnpm 10 changed the lockfile syntax slightly, so we need to keep
everyone using v9 until we handle the upgrade.
2025-02-04 09:18:15 +00:00
Joffrey JAFFEUX
1a8b5b9d42
FIX: better standalone checkbox support (#31130)
Before this commit it was complicated to render a `Checkbox` outside of
a `CheckboxGroup` as you would get no title, no description, no optional
hint and not tooltip.

This commits makes all of this possible by adding a special case for
checkboxes, and sharing code for tooltips and optional hint.

This commit also uses this opportunity to refactor part of the code to
use curryComponent and reduce code duplication.
2025-02-04 09:58:00 +01:00
Ted Johansson
503f9b6f02
DEV: Use default admin routes for plugins with settings (#30941)
This change adds a sidebar link for each plugin that fulfils the following criteria:

- Does not have an explicit admin route defined in the plugin.
- Has at least one site setting (not including enabled/disabled.)

That sidebar link leads to the automatically generated plugin show settings page.
2025-02-04 14:57:28 +08:00
Martin Brennan
91e9c1c813
UX: Hide inner site settings sidebar if admin sidebar enabled (#31047)
This experiment hides the list of categories in the inner
sidebar for the main site settings page if the admin sidebar
is enabled. It also defaults the list of settings to "All"
instead of a specific category.

Our theory here is that people who use this page are using
it to find an exact setting, not to go through the categories
one by one. Our admin sidebar also has several groups of important
settings already too, so that can be used for browsing.

Finally, the input on the page focuses when you load it, so
filtering is faster.
2025-02-04 09:24:03 +10:00
dependabot[bot]
fe9086fdfa
Build(deps): Bump ember-template-imports from 4.2.0 to 4.3.0 (#31111)
Bumps
[ember-template-imports](https://github.com/ember-template-imports/ember-template-imports)
from 4.2.0 to 4.3.0.
- [Release
notes](https://github.com/ember-template-imports/ember-template-imports/releases)
-
[Changelog](https://github.com/ember-cli/ember-template-imports/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/ember-template-imports/ember-template-imports/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-03 19:56:12 +01:00
Martin Brennan
5bc7371192
FEATURE: Localization admin settings config page (#31085)
This commit adds a new Localization config page for
admins, as a basic filtered site setting page similar
to Legal and Notifications. Included settings are:

* default locale
* allow user locale
* set locale from accept langauge header
* onebox locale
* display local time in user card
* discourse local dates enabled
* support mixed text direction
* unicode usernames
* allowed unicode username characters
2025-01-31 12:55:30 +10:00
Martin Brennan
7fd9550f64
DEV: Change dIcon to icon in components (#31083)
Apparently `icon` is the preferred nomenclature
2025-01-31 10:55:31 +10:00
Martin Brennan
95a759092e
UX: Show full total numbers in admin reports (#31061)
This commit updates the display of totals and table
rows for reports in the admin interface. Currently
we show abbreviated numbers for totals e.g. 2.1M
which is not helpful when you need accurate data.
We are also not adding locale-specific number separators
so the row numbers are hard to read e.g. 246999 instead
of 246,999.

This commit fixes both issues to improve the UX of reports
without having to export them.

**Before (totals)**


![image](https://github.com/user-attachments/assets/6958252d-f778-495d-b799-7ebe4e9f1366)

**After (totals)**


![image](https://github.com/user-attachments/assets/2b51580a-cd09-42cd-b713-3c5018fa6727)

**Before (rows)**


![image](https://github.com/user-attachments/assets/38d36236-1382-45b2-a3dc-5b267b122e39)

**After (rows)**


![image](https://github.com/user-attachments/assets/607997b7-7a46-452a-ab6e-368671445a06)
2025-01-31 09:55:05 +10:00
Jarek Radosz
d1c33076f3
DEV: Clean up TreeNode component (#31069)
1. use `constructor` instead of `didInsert`
2. remove non-existent `unregisterInputFieldObserver` arg usage
3. don't curry `@index` arg twice in `@onClick`
4. use `@bind`
5. use `concatClass`
6. `dIcon` -> `icon`
2025-01-31 00:50:43 +01:00
Neil Lalonde
0ef9abe0f0
DEV: add plugin outlet around new color palette button (#31054) 2025-01-30 10:11:19 -05:00
Joffrey JAFFEUX
d217e61411
DEV: finer format control on field title/description (#31071)
FormKit allows you to set `@format` on a field which will set the width
of the wrapping container of the control. However, title and
descriptions are out of this container. FormKit will now by default
applies the same format to title and description.

You can override this behavior by using `@titleFormat` and
`@descriptionFormat`.
2025-01-30 13:39:05 +01:00
Martin Brennan
15838aa756
DEV: Convert AdminReport component to gjs (#31011)
This commit converts the `AdminReport` component, which is quite
high complexity, to gjs. After this initial round, ideally this
component would be broken up into smaller components because it is
getting quite big now.

Also in this commit:

* Add an option to display the report description in a tooltip, which
was
   the main way the description was shown until recently. We want to use
   this on the dashboard view mostly.
* Move admin report "mode" definitions to the server-side Report model,
inside a `Report::MODES` constant, collecting the modes defined in
various
   places in the UI into one place
* Refactor report code to refer to mode definitions
* Add a `REPORT_MODES` constant in JS via javascript.rake and refactor
  JS to refer to the modes
* Delete old admin report components that are no longer used
  (trust-level-counts, counts, per-day-counts) which were replaced
  by admin-report-counters a while ago
* Add a new `registerReportModeComponent` plugin API, some plugins
   introduce their own modes (like AI's `emotion`) and components and
   we need a way to render them
2025-01-29 10:33:43 +10:00
Kris
f6c5eca485
DEV: add btn-default classes to buttons using default styling (#31039)
All of these buttons use our default grey background styling, but aren't
carrying the `btn-default` class, which makes them easier to target in
themes. This PR adds the class.
2025-01-28 15:40:34 -05:00
Ted Johansson
907db4d5fd
DEV: Remove plugin sidebar rendering fallback (#31012)
We used this flag for experimenting with admin plugin sidebars. We have now settled on a tabbed layout, and this is no longer needed.

This PR simply ignores the flag in a backwards-compatible way, so we can discontinue usage in plugins and then remove the backwards-compatibility in core.
2025-01-28 09:42:24 +08:00
dependabot[bot]
a5f533667d
Build(deps): Bump the babel group with 2 updates (#31001)
Bumps the babel group with 2 updates:
[@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core)
and
[@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/core` from 7.26.0 to 7.26.7
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/babel/babel/commits/v7.26.7/packages/babel-core)

Updates `@babel/standalone` from 7.26.6 to 7.26.7
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/babel/babel/commits/v7.26.7/packages/babel-standalone)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 22:54:03 +01:00
Renato Atilio
0d240308c8
FIX: reset bool site setting not updating checkbox (#30999) 2025-01-27 10:53:27 -03:00
Ted Johansson
ad8f9465c3
FIX: Minor i18n problems on admin webhooks pages (#31010)
This fixes two minor problems on the admin webhooks page.

- Wrong key used for edit button title in listing.
- Duplicated use of `i18n` leading to "en.Edit" in show page.
2025-01-27 13:46:35 +08:00
Gary Pendergast
37d1212865
FIX: Show the correct message when no user export exists. (#30970)
Followup to 7fc8d74f3eed52116add452b5321b41e02e04499

We need to check that the user export data exists before creating a model, since having an empty model will cause the UI to incorrectly think there's a user export to display.

This change shows the correct message, instead.
2025-01-24 11:38:07 +11:00
Kris
aa90ba2992
UX: fix admin dashboard link and style regressions (#30969)
Heading link regression reported here:
https://meta.discourse.org/t/admin-panel-reports-in-the-community-health-section-are-no-longer-clickable/347631

Also noticed some style regressions
2025-01-24 10:23:34 +10:00
Gary Pendergast
7fc8d74f3e
FEATURE: Allow admins to export users (#30918)
The GDPR requires all users to be able to export their data, or request an export of their data. This is fine for active users as we have a data export button on user profiles, but suspended users have no way of accessing the data export function, and the workaround for admins to export data for suspended users involves temporarily unsuspending them, then impersonating the user to export the data as them.

Since suspended users no longer have access to their account, we can safely assume that the export request will be coming via a medium outside of Discourse (eg, email). This change is built with this workflow in mind.

This change adds a new "User exports" section to the admin user page, allowing admins to start a new export, and to download the latest export file.
2025-01-24 08:13:25 +11:00
Ted Johansson
0718f940fa
DEV: Use RouteTemplate for admin API keys template (#30835)
This is a small clean-up PR that does the following:

- Convert api-keys.hbs to a RouteTemplate backed api-keys.gjs.
- Move the sub-page templates (index, show, new) into /api-keys sub-directory.
- Removes some styles that aren't used after the admin UI conversion.
2025-01-17 11:22:47 +08:00
Martin Brennan
f329acba71
UX: Wizard and theme install modal improvements (#30788)
* Fix tabbing inputs on first wizard step, the user would end up on
"Skip to content"
for the page "behind" the wizard. If the wizard is showing we can just
not render the skip to content element
* Only show the required wizard steps in the counter, so we do X/4
rather than X/6 at the top of the page. 
* Change to "Setting up your theme..." by default, but if the install
takes 10s or more add a note that things are still happening and to
be patient.
2025-01-16 13:53:09 +10:00
Ted Johansson
5c0b7c4d70
Admin webhooks UI guidelines (#30764)
This change converts the admin webhooks UI to the new UI guidelines and modernizes the JS.
2025-01-16 10:22:18 +08:00
Gary Pendergast
99f5670c30
UX: Tweak plugin and customize-based admin page margins (#30808)
Admin pages that are based off the customize or plugin templates were wrapped in the `admin-container` class, which has slightly different margins to the `admin-config-page` class, which is used on most admin pages.

This change ensures that all the admin pages have the same alignment.
2025-01-16 09:44:43 +11:00
Gary Pendergast
27f278253b
UX: Use DPageHeader on the Logs page (#30786)
Update the header of the admin Logs page to be more consistent with the rest of the admin UI.

The tabs to access the different sub-pages have also been updated.
2025-01-16 07:42:34 +11:00
Gary Pendergast
d144826fa7
UX: Use DPageHeader on the Email Style page (#30784)
Update the header of the admin Email Style page to be more consistent with the rest of the admin UI.

The HTML/CSS tabs have also been updated, which required an extra check being added to the NavItem component.
2025-01-15 16:53:45 +11:00
Gary Pendergast
5da6a06ce3
UX: Use DPageHeader on the Emails page (#30781)
There are a few changes here to make the Emails admin page more consistent with the rest of the admin UI.

- The header and navigation menu have been updated.
- The sidebar now stays highlighted when visiting the email admin sub-pages.
- Moved the Template editor from /admin/customize/email_templates to /admin/email/templates, so it fit as a sub-page.
- Removed the link to the Template editor from the Customize section of the old top menu, since it's accessible from the Emails section, instead.
2025-01-15 15:36:16 +11:00
Gary Pendergast
698e7a17dd
UX: Use DPageHeader on the Site Settings page (#30783)
Update the header of the admin Site Settings page to be more consistent with the rest of the admin UI.
2025-01-15 15:19:11 +11:00
Gary Pendergast
dbc9fbfd8b
UX: Use DPageHeader on the Components page (#30762)
This change updates the header of the admin Components page to be more consistent with the rest of the admin UI.

The Themes and Components pages share the same templates, so this change switches the header based on which tab is active.
2025-01-14 17:58:08 +11:00
Gary Pendergast
36bbe0a0a6
UX: Use DPageHeader on the Themes page (#30759)
This change updates the header of the admin Themes page to be more consistent with the rest of the admin UI.
2025-01-14 17:00:15 +11:00
Martin Brennan
dc0bf90069
UX: Apply admin UI guidelines to Reports pages (#30684)
Applies the admin UI guidelines from
https://meta.discourse.org/t/creating-consistent-admin-interfaces/326780
to the reports list and single report page for admins.


![image](https://github.com/user-attachments/assets/2431901f-0225-4658-b408-ab0865d022e6)

![image](https://github.com/user-attachments/assets/6f9e531b-8fec-405f-8429-151fd261ee2c)

---------

Co-authored-by: Ella <ella.estigoy@gmail.com>
2025-01-14 13:22:08 +10:00
David Taylor
d2ee0609a6
DEV: Remove discourse-common package (#30741)
All modules have now been migrated to `discourse/`
2025-01-13 16:01:51 +00:00
David Taylor
98fa42f2e2
DEV: Move discourse-common/config/environment to discourse/lib (#30738) 2025-01-13 15:29:26 +00:00
David Taylor
0ed4b09527
DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733)
`discourse-common` was created in the past to share logic between the
'wizard' app and the main 'discourse' app. Since then, the wizard has
been consolidated into the main app, so the separation of
`discourse-common` is no longer useful.

This commit moves `discourse-common/(lib|utils)/*` into
`discourse/lib/*`, adds shims for the imports, and updates existing
uses in core.
2025-01-13 13:02:49 +00:00
David Taylor
979325c500
DEV: Move discourse-common/ helpers to discourse/ (#30728)
`discourse-common` was created in the past to share logic between the
'wizard' app and the main 'discourse' app. Since then, the wizard has
been consolidated into the main app, so the separation of
`discourse-common` is no longer useful.

This commit moves `discourse-common/helpers/*` into
`discourse/helpers/*`, removes `discourse-common` from the Ember
resolver config, and adds shims for the imports.
2025-01-13 09:36:11 +00:00
Martin Brennan
0caeadd9b1
FEATURE: Add IP Lookup to review queue (#30688)
Moves the theme component
https://github.com/discourse/discourse-review-ip-lookup into core, this
allows looking
up a user's IP directly from the review queue and seeing if
there are other users with the same IP on the forum
2025-01-13 13:03:13 +10:00
Ted Johansson
3e00e994a6
FIX: Add back API keys plugin outlet lost in translation (#30730)
When converting the admin API keys page to the new admin UI guidelines we lost a plugin outlet. This adds that back.
2025-01-13 10:32:57 +08:00
Martin Brennan
690ffcf1d5
UX: Add DPageHeader to watched words and color palettes (#30686)
Part of our admin UI consistency efforts, this is a stop-gap
until we can do a further UI review of these pages.
2025-01-10 15:32:10 +10:00
Ted Johansson
d566cbbf45
DEV: Add missing root breadcrumb to API keys page (#30690)
Addressing a couple minor inconsistencies on the admin API keys page.

1. Add missing "Admin" root breadcrumb.
2. De-titleize "API Keys" -> "API keys".
2025-01-10 13:19:34 +08:00
Ted Johansson
4a78999b6f
DEV: Add new admin UI header to site texts page (#30689)
This adds the new admin UI header to the site texts page.
2025-01-10 13:19:14 +08:00
Ted Johansson
b1bae9b785
FIX: Add back missing API key 'peek' step (#30683)
In #30096 we converted the API keys UI to follow the new admin UI guidelines.

During this conversion, the step where you get a chance to copy the API key after creating, was lost due to a rebase mistake.

This re-introduces it.
2025-01-10 10:21:22 +08:00
Martin Brennan
f4b417462b
UX: Final pass of admin setting pages (#30682)
This commit finalises the admin setting page consistency
efforts by:

* Converting all route templates into .gjs
* Adding `@hideTabs={{true}}` for all the page headers so we
  don't show a border line when it's not needed
* Introduce `@showBreadcrumb` and default to true for
  AdminAreaSettings, for all these pages the Settings part of
  the breadcrumb is redundant
2025-01-10 11:03:07 +10:00
Ted Johansson
590b3e11fb
DEV: Convert admin API keys to conform to UI guidelines (#30660)
Re-opening of #30096. It was reverted because it was missing a sidebar link to Webhooks in the admin panel.
2025-01-09 10:57:40 +08:00
Gary Pendergast
8fea8e846f
UX: Use FontSelector for displaying font-related settings. (#30636)
3135f472e2c4221a9348aec27514d3e2947bc9ab added a nifty new FontSelector component, which creates a dropdown where each item is styled in the font that it corresponds to.

This change uses the new component to style the base_font and heading_font site setting selectors, too.
2025-01-09 09:57:38 +11:00