Commit Graph

22610 Commits

Author SHA1 Message Date
Martin Brennan 2d2329095c
FEATURE: Use new bookmark menu in topic footer buttons (#26670)
Followup to 67a8080e33

This commit makes it so the topic footer button for bookmarks
uses the new BookmarkMenu component, and makes some tweaks to
that component to allow for a label and CSS class options.

Also introduces a TopicBookmarkManager to manage the saving/editing/
deleting of the topic level bookmarks and the reactivity that happens
in the topic UI afterward.

Next commit should rip out old bookmark associated code in the
topic controller as it will no longer be needed.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2024-04-18 11:06:12 +02:00
Joffrey JAFFEUX 09311c7dab
DEV: minimum fabricators for post/topic (#26671)
I will add new default properties as needed in the future, but for now this is enough to have an entry point.
2024-04-18 09:54:23 +02:00
Martin Brennan 99d22c85ae
FEATURE: Make admin sidebar keywords translateable (#26657)
This commit ensures that additional keywords for admin
sidebar links (which are also stored in the admin sidebar state
manager) are translated with I18n, which was discussed
in https://meta.discourse.org/t/introducing-experimental-admin-sidebar-navigation/289281/58?u=martin

This also changes the admin sidebar state manager keywords to
not be a TrackedObject -- this is not necessary as keywords are
only set once, and it was causing rendering issues because
the keywords were being set at the same time they were read.

Finally this adds a "theme" keyword to the "Components" link
because we often refer to components as Theme Components

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-04-18 16:14:11 +10:00
Kelv edbd44e737
DEV: replace transformed-post POJO with topic model in topic-map components (#26629)
* DEV: replace postAttrs dependencies in topic-map component by passing in topicDetails and postStream to topic-map to ensure state changes are passed properly down to child components
2024-04-18 10:04:38 +08:00
Krzysztof Kotlarek 98fc614162
FEATURE: mandatory fields for group site setting (#26612)
Automatically add `moderators` and `admins` auto groups to specific site settings.

In the new group-based permissions systems, we just want to check the user’s groups since it more accurately reflects reality

Affected settings:
- tag_topic_allowed_groups
- create_tag_allowed_groups
- send_email_messages_allowed_groups
- personal_message_enabled_groups
- here_mention_allowed_groups
- approve_unless_allowed_groups
- approve_new_topics_unless_allowed_groups
- skip_review_media_groups
- email_in_allowed_groups
- create_topic_allowed_groups
- edit_wiki_post_allowed_groups
- edit_post_allowed_groups
- self_wiki_allowed_groups
- flag_post_allowed_groups
- post_links_allowed_groups
- embedded_media_post_allowed_groups
- profile_background_allowed_groups
- user_card_background_allowed_groups
- invite_allowed_groups
- ignore_allowed_groups
- user_api_key_allowed_groups
2024-04-18 08:53:52 +10:00
Kris 1dbceb1a70
UX: when reopening collapsed composer, reset height (#26661) 2024-04-17 17:28:18 -04:00
Jarek Radosz 84efa66cc1
DEV: Apply `flex-direction: column` on `.d-header` (#26658)
This doesn't change anything in 99.9% of cases - by default d-header has only one child element `.wrap`.

There are only two themes that I'm aware of that add another child:
1. discourse-categories-navbar - which I'm currently updating to use the new header APIs, and where the column layout makes more sense
2. a private theme, which was recently updated to use those APIs and that works around the current layout by applying `flex-wrap: wrap` to d-header (I'll remove that override as it conflicts with this change)
2024-04-17 23:00:55 +02:00
Daniel Waterworth 7ce5eac235
FIX: Don't put non-category in Site.categories (#26664) 2024-04-17 15:54:34 -05:00
Bianca Nenciu 9638ce17fa
FIX: Serialize categories for bookmarks (#26606)
This is necessary when "lazy load categories" feature is enabled to make
sure the categories are rendered for topics and posts.
2024-04-17 17:23:47 +03:00
David Taylor 840ac6bd0a
DEV: Avoid using @tracked as a decorator in RenderGlimmer object literal
Decorators in object literals are non-standard, and we're working to remove them.
2024-04-17 15:19:23 +01:00
Joffrey JAFFEUX 552859b0ff
DEV: converts discard-draft modal to gjs (#26637) 2024-04-17 13:11:50 +02:00
Krzysztof Kotlarek df373d90fe
FEATURE: direct link to components for admin sidebar (#26644)
To add a components link to the sidebar refactoring was required to create unique URLs for themes and components. Before the query param was used. After changes, we have two URLs `/admin/customize/themes` and `/admin/customize/components`.
2024-04-17 11:45:59 +10:00
Daniel Waterworth 56c4804440
DEV: Always pass ancestors to category-link (#26638)
We want to remove uses of Category.findById. This change pushes the fetching up the chain of responsibility.
2024-04-16 15:28:36 -05:00
dependabot[bot] 57d29b6f3b
Build(deps-dev): Bump ember-cli from 5.7.0 to 5.8.0 (#26641)
Bumps [ember-cli](https://github.com/ember-cli/ember-cli) from 5.7.0 to 5.8.0.
- [Release notes](https://github.com/ember-cli/ember-cli/releases)
- [Changelog](https://github.com/ember-cli/ember-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ember-cli/ember-cli/compare/v5.7.0...v5.8.0)

---
updated-dependencies:
- dependency-name: ember-cli
  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>
2024-04-16 17:42:33 +01:00
Joffrey JAFFEUX 4f7cd7b78e
FIX: correctly unshrink composer when re-editing post (#26650)
Prior to this fix we were manually expanding the composer but not setting the correct height. This commit adds a new `unshrink` function on the composer service to correctly set the state and the height on the composer model.
2024-04-16 14:49:51 +02:00
Joffrey JAFFEUX 8fbdce36a4
FIX: prevents open to happen too early (#26649)
In discourse-assign the assign menu in the modal is using this `expandedOnInsert` option and  was sometimes not opening correctly resulting in a broken state until you click two times on it. This should prevent this issue.
2024-04-16 13:58:06 +02:00
Jarek Radosz 99391277d4
DEV: Remove an unused hbr template (#26620) 2024-04-16 12:58:18 +02:00
David Taylor 1be488e4fb
DEV: Consolidate message-bus ajax implementation (#26646)
Previously it was split across multiple functions, and had multiple logic branches. This commit consolidates it into a single `mbAjax` function
2024-04-16 11:16:04 +01:00
Joffrey JAFFEUX bbe62d88d2
FIX: prevents showing discard modal on re-edit (#26639)
This commit will now change two behaviors:

- If composer is already opened on a specific post and we click on edit again for the same post, we will do nothing and not show the discard draft modal
- if composer is shrinked and we click on edit for the same currently edited post, we will just open the composer and not show the discard draft modal
2024-04-16 10:34:32 +02:00
dependabot[bot] f8d6d58658
Build(deps-dev): Bump sass from 1.74.1 to 1.75.0 (#26625)
Bumps [sass](https://github.com/sass/dart-sass) from 1.74.1 to 1.75.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.74.1...1.75.0)

---
updated-dependencies:
- dependency-name: sass
  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>
2024-04-16 00:28:46 +02:00
Blake Erickson 9338a9f2dc
DEV: Update constants (#26580)
I needed to run `rake javascript:update_constants` for my previous
commit: 72ac675e4e

The change in this commit though was completely unrelated, so I saved it
for it's own commit.
2024-04-15 15:17:45 -06:00
Martin Brennan 8640d3c82d
FIX: Wait for bookmark save before allowing menu button click (#26626)
This fixes a timing issue where, if a user (or the CI) was
on a slow network connection, clicking one of the bookmark
menu options would cause an error because we hadn't yet received
the response from the server after creating the bookmark.

It should be very smooth most of the times because (paraphrasing j.jaffeux):

a) Most likely when user clicks it’s already saved
b) If it’s not saved when user clicks, it should already be almost done so
   the perceived wait when click the reminder option should be rather short
2024-04-15 14:45:11 +02:00
Joffrey JAFFEUX 326da84373
FIX: deleting a groups was throwing an error (#26623) 2024-04-15 08:35:50 +02:00
Bianca Nenciu 38e1706b61
FIX: Update category breadcrumbs more reliably (#26608)
The breadcrumbs were updated everytime there were changes to the
categories which was not efficient and caused unnecessary rerendering
of the CategoryDrop elements when "lazy load categories" is enabled.

This commit also ensures that all category fields are serialized for
ancestors too for the categories#search endpoint.
2024-04-12 11:56:32 +03:00
Jarek Radosz 4d2dcdad9b
UX: Emoji aligment fixes, followup to #26491 (#26618) 2024-04-12 10:48:14 +02:00
Jarek Radosz f296881703
FIX: Broken timeline back button title (#26604)
"[en.Go back to your last unread post]" ain't it 😉
2024-04-12 10:36:07 +02:00
David Battersby 11eb4153fa
UX: prevent toasts from covering header (#26615)
This change prevents toast notifications from blocking the header and user navigation on both desktop and mobile.
2024-04-12 15:49:23 +08:00
David Battersby 2706f7ed74
DEV: set toast progress bar to false by default (#26614)
This change disables the toast notification progress bar by default. It can be enabled for a specific toast by setting showProgressBar: true.
2024-04-12 14:27:10 +08:00
Martin Brennan 973a0028b4
FEATURE: Bulk topic tagging allowing restricted operations on sole categories (#26602)
The bulk actions menu for topics has multiple options to work
with tags on topics (append, replace, remove). Our tagging system
along with categories allows for some complicated tag restrictions
to be applied via tag groups. This was a problem for the topic bulk
actions because you couldn't append restricted tags to topics.

This commit allows restricted tags to be used in bulk tagging actions
as long as all selected topics are for a sole category. The category
information will be shown in the modal, and the category ID is used
for the tag search.
2024-04-12 13:10:14 +10:00
Blake Erickson 334a2f216f
FEATURE: User Notifications Links Page (#26609) 2024-04-11 15:54:28 -06:00
Daniel Waterworth cead0cf684
DEV: Remove Category.findById from admin web hooks (#26605)
Include categories when fetching admin/web_hooks and make
'extras' more useful. 'extras' is the mechanism we use to provide
context for rest objects.

However, previously:

 * When you fetched many objects, extras was only set on the ResultSet,
   not on each object,

 * If you need derived data from extras, there wasn't a sensible place to
   put this code. Now, you can create an 'ExtrasClass' static field on
   your rest model and this class will be used for your extras data,
2024-04-11 16:11:00 -05:00
dependabot[bot] 4f2b44ba9f
Build(deps-dev): Bump the embroider group with 4 updates (#26595)
Bumps the embroider group with 4 updates: [@embroider/compat](https://github.com/embroider-build/embroider/tree/HEAD/packages/compat), [@embroider/core](https://github.com/embroider-build/embroider/tree/HEAD/packages/core), [@embroider/macros](https://github.com/embroider-build/embroider/tree/HEAD/packages/macros) and [@embroider/webpack](https://github.com/embroider-build/embroider/tree/HEAD/packages/webpack).


Updates `@embroider/compat` from 3.4.6 to 3.4.7
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/compat)

Updates `@embroider/core` from 3.4.6 to 3.4.7
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/core)

Updates `@embroider/macros` from 1.15.0 to 1.15.1
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/macros)

Updates `@embroider/webpack` from 3.2.2 to 3.2.3
- [Release notes](https://github.com/embroider-build/embroider/releases)
- [Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/webpack)

---
updated-dependencies:
- dependency-name: "@embroider/compat"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/macros"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
- dependency-name: "@embroider/webpack"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: embroider
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 09:28:38 +02:00
Alan Guo Xiang Tan f095494936
UX: Improve the identifier for categories typed prop in theme objects editor (#26600)
This commit changes the identifier displayed in the navigation tree of
the theme objects editor from the generic "category 1" to "<category
name>, <category 2 name>" when a property of typed categories is set as
the identifier.

Example:

For the following theme objects schema:

```
some_setting:
  type: objects
  default: []
  schema:
    name: <some scheme name>
    identifier: list_of_categories
    properties:
      list_of_categories:
        type: categories
```

If the `list_of_categories` property's value has been set to `category
1` and `category 2`, the navigation tree will display `category 1,
category 2` as the text to represent the object in the navigation tree.
2024-04-11 13:00:07 +08:00
Bianca Nenciu 8ce836c039
FIX: Load categories with user activity and drafts (#26553)
When lazy load categories is enabled, categories should be loaded with
user activity items and drafts because the categories may not be
preloaded on the client side.
2024-04-10 17:35:42 +03:00
David Taylor 3733db866c
DEV: Introduce default 'auto' mode for glimmer header (#26467)
This will automatically enable the glimmer header when all installed themes/plugins are ready. This replaces the old group-based site setting.

In 'auto' mode, we check for calls to deprecated APIs (e.g. decorateWidget) which affect the old header. If any are present, we stick to the old header implementation and print a message to the console alongside the normal deprecation messages.

To override this automatic behavior, a new `glimmer_header_mode` site setting can be set to 'disabled' or 'enabled'.

This change also means that our test suite is running with the glimmer header. This unveiled a couple of small issues (e.g. some incorrect `aria-*` and `alt` text) which are now fixed. A number of selectors had to be updated to ensure the tests were clicking the actual `<button>` elements rather than the surrounding `<li>` elements.
2024-04-10 14:35:54 +01:00
Arpit Jalan 5d0471ebe4
FEATURE: add new plugin outlet 'after-header' (#26587)
* FEATURE: add new plugin outlet 'after-header'

* Add to widget version

* fix linting

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2024-04-10 16:26:57 +05:30
Isaac Janzen f8dd468caa
DEV: Update `headerIcons` API (#26090)
- Remove panelPortal usage, which allowed for content to be added as a dropdown
- Instead rely on float-kit's DMenu to render a dropdown
2024-04-10 11:37:37 +01:00
Régis Hanol 8509fc2ebc DEV: refactor (composer|d)-editor.js
This started as a way to prevent "previewUpdated" from doing the same work twice when morphing.

Ended up refactoring "previewUpdated" and extracted into 5 distinct methods for clearer understanding and more consistent debouncing (using the "@debounce" decorator instead of the "discourseDebounce" method).

No "feature" was changed, other than not doing the "decorateCookedElement" when morphing is enabled, since we already did it _before_ morphing.
2024-04-10 10:36:20 +02:00
Régis Hanol 84d4dca4ab FIX: morph after all the "decorateCookedElement"
A lot of plugins are using "api.decorateCookedElement" to decorate the cooked preview.

Some of those plugins, like the "image-grid" ([grid]...[/grid]), changes the DOM. We have to call them _before_ morphing otherwise, there's no real point in morphing the preview.

The missing piece was triggering the "decorate-non-stream-cooked-element" application event.
2024-04-10 10:36:20 +02:00
Régis Hanol db77803ca3 DEV: refactor column.js 2024-04-10 10:36:20 +02:00
Jarek Radosz 98ec4af327
FIX: Add the ident to fix user status styling in posts (#26585) 2024-04-10 01:44:37 +02:00
dependabot[bot] f687d91b99
Build(deps-dev): Bump qunit-dom from 3.1.0 to 3.1.1 (#26583)
Bumps [qunit-dom](https://github.com/mainmatter/qunit-dom) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/mainmatter/qunit-dom/releases)
- [Commits](https://github.com/mainmatter/qunit-dom/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: qunit-dom
  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>
2024-04-10 01:34:49 +02:00
dependabot[bot] 3b85ae89c6
Build(deps-dev): Bump babel-import-util from 2.0.1 to 2.0.2 (#26582)
Bumps [babel-import-util](https://github.com/ef4/babel-import-util) from 2.0.1 to 2.0.2.
- [Commits](https://github.com/ef4/babel-import-util/compare/v2.0.1...v2.0.2)

---
updated-dependencies:
- dependency-name: babel-import-util
  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>
2024-04-10 01:34:35 +02:00
Ella E 002ff94ded
UX: Display JIT when user list is empty (#26579)
* UX: Display JIT when user list is empty

* UX: Remove empty state heading

* DEV: add spacing by enclosing empty state body in <p> tag
2024-04-09 13:52:21 -06:00
Blake Erickson 72ac675e4e
FEATURE: Consolidate link notifications (#26567)
Just like we have for consolidating likes this adds similar
functionality for consolidating links.
2024-04-09 11:53:37 -06:00
Jarek Radosz d16bc06b66
UX: Fix user menu ellipsis color (#26578) 2024-04-09 17:20:26 +02:00
Jarek Radosz f5c9e75438
UX: Fix alignment issues around user status (#26491)
Minor changes but they 1. correct the html structure (no divs in spans) 2. unify the margins
2024-04-09 11:10:12 +02:00
David Taylor a601813a6c
DEV: Drop unused shims for Ember 3 deprecations (#26563)
These deprecation shims are no-ops under Ember 5.
2024-04-09 09:22:37 +01:00
David Taylor 2a5d4ede6d
DEV: Set `samesite=lax` on cookies set by client-side (#26559)
Chrome's default is already Lax, so this change is a no-op there.

Firefox will soon be follow them, and has started warning about cookies with no samesite attribute. That's the motivation for this commit.
2024-04-09 09:22:20 +01:00
Martin Brennan d7f7915558
FIX: Bookmark clock icon not showing (#26572)
When choosing the "Custom..." option in the new bookmark
menu and then choosing a date + time in the modal for the
reminder, the bookmark icon on the post was not updating to
show the one with the clock to indicate the reminder.

This was just a data syncing issue between BookmarkFormData
and what the modal sets. Ideally all this would be refactored
because the data flow is messy...but hard to find time for
that right now.

Followup 67a8080e33
2024-04-09 16:14:59 +10:00