Commit Graph

27183 Commits

Author SHA1 Message Date
fad94160c7 FIX: uses tippy for popover (#15409)
Note this commit also introduce a new {{d-popover}} component, example usage:

```hbs
{{#d-popover |state|}}
  {{d-button label="foo.things" class="d-popover-trigger"}}

  <div class="d-popover-content">
    Some content
  <div>
{{/d-popover}}
```
2022-05-02 17:10:26 +02:00
4885a2535a UX: Display user.username on user cards (#16539)
If you happen to mention someone with the wrong capitalization for that
person's username (e.g. `@sAm`), that incorrect capitalization would get
displayed on their user card.

This update will fix that by displaying the `user.username` value, which
will have the correct capitalization.

I also added some tests that will ensure `username` and `name` are
displayed on the user card in the correct order based on the
`prioritize_username_in_ux` setting.

This issue was reported here:
https://meta.discourse.org/t/capitalization-does-not-match-when-you-open-user-cards-using-mentions/217166
2022-05-02 09:28:50 -04:00
187922d51c FEATURE: introduce a sitewide setting for disabling suggesting weekends in time pickers (#16563) 2022-05-02 15:40:23 +04:00
c76f684320 UX: Reset mark element highlight for WCAG schemes (#16593) 2022-04-29 14:22:26 -04:00
0f772bdf5b FEATURE: Optionally skip using full_name when suggesting usernames (#16592)
This commit introduces a new site setting: `use_name_for_username_suggestions` (default true)

Admins can disable it if they want to stop using Name values when generating usernames for users. This can be useful if you want to keep real names private-by-default or, when used in conjunction with the `use_email_for_username_and_name_suggestions` setting, you would prefer to use email-based username suggestions.
2022-04-29 14:00:13 +01:00
badde13894 UX: improve the list of options on the slow mode modal (#16561) 2022-04-28 17:05:32 +04:00
1928bb6ac6 FIX: show group in filter only if user can see the members list. (#16580) 2022-04-28 18:27:47 +05:30
bcb22821fb DEV: Add support for GH Codespaces to ember proxy (#16581) 2022-04-28 14:46:59 +02:00
008b700a3f DEV: Upgrade to Rails 7
This patch upgrades Rails to version 7.0.2.4.
2022-04-28 11:51:03 +02:00
532f9cdb1a DEV: Partially revert 98c49acad5fbacee543505313998e4f05d0b35c7 (#16578)
Use of glimmer component breaks site not on Ember CLI.
2022-04-28 16:01:58 +08:00
0f7b198ca0 FIX: Ensure values are escaped in select-kit dropdowns (#16576)
The values in Discourse dropdown menus only come from admin-defined strings, not unsanitised end-user input, so this lack of escaping was not exploitable.
2022-04-28 08:52:29 +01:00
98c49acad5 DEV: Setup experimental sidebar skeleton (#16575)
* hidden siteSetting to enable experimental sidebar
* user preference to enable experimental sidebar
* `experimental_sidebar_enabled` attribute for current user
* Empty glimmer component for Sidebar
2022-04-28 15:27:06 +08:00
14b09c9909 UX: Move post date under title in share-modal (#16455)
The old position was less than ideal on mobile.
2022-04-27 16:36:08 +03:00
c9b2374299 DEV: make API of future-date-input more customizable and aligned with the API of time-shortcut-picker (#16502) 2022-04-27 16:41:15 +04:00
3e23bd4745 FIX: prepare data before creating chart to avoid side effect (#16570)
Before this change, we were using the labels from the original chartData to the chart builder, and we would then apply our collapse function on each dataset which could change the labels and cause a mismatch.

This was very visible when using quarterly periods on consolidated pageviews.
2022-04-27 14:04:09 +02:00
eebce8f80a FEATURE: Add in:messages search modifier (#16567)
This adds `in:messages` as a synonym for `in:personal` and sets it up as our default nomenclature (`in:personal` will still work).
2022-04-26 16:47:01 -04:00
8dd3d6cb97 UX: Larger clickable area for mobile topic list (#16473) 2022-04-26 15:01:43 -04:00
07f975848d FEATURE: Scope search to PMs when in that context (#16528) 2022-04-26 14:43:09 -04:00
5e34ce1282 DEV: Ensure theme tests are always loaded in a consistent order (#16569)
If they aren't, then the digest will be different, causing unexpected issues
2022-04-26 17:05:57 +01:00
144b87b17a UX: fix topic admin menu layout for short screens (#16565) 2022-04-26 10:27:45 -04:00
020d862baa UX: Tweak topic-admin-menu alignment/size (#16564)
* Increase the space between icons and labels
* Increase the menu width
2022-04-26 16:02:46 +02:00
0b9410d96f DEV: prefix group name when appended as class (#16556) 2022-04-26 08:31:27 -04:00
329a64969c UX: prevent group mention from wrapping (#16558) 2022-04-26 08:30:55 -04:00
c8757c9d1d FIX: prefers computed over discourseComputed (#16562)
We have currently unexpected behaviors when using @discourseComputed in a native class.
2022-04-26 11:43:41 +02:00
3e0cb8ea47 UX: ask for confirmation when deleting a post using shortcut (#16526) 2022-04-25 17:50:54 -04:00
c1d9822003 UX: Fix a few WCAG color scheme contrast issues (#16554) 2022-04-25 17:07:35 -04:00
4157403308 UX: organize topic admin menu into groups (#16489) 2022-04-25 16:02:41 -04:00
2a96bca7a1 FIX: Correctly handle the print param on topics#show. (#16555)
The controller incorrectly sets print to true when passing `print=false`, which causes the rate limit to perform.
2022-04-25 16:04:13 -03:00
596469a712 REFACTOR: live-development.js (#16548)
- drop jquery
- replaces setTimeout by later
- removes dead code which is not even working today
2022-04-25 19:34:16 +02:00
922fbe82da DEV: Ensure custom_fields_clean? returns false when values change (#16552)
We were calling `dup` on the hash and using that to check for changes. However, we were not duplicating the values, so changes to arrays or nested hashes would not be detected.
2022-04-25 17:19:39 +01:00
32346f4ba5 FIX: Ensure lazy-load-images does not remove entire img.style (#16553)
Other things may have added things to the style attribute (e.g. the `image-aspect-ratio` decorator).

Unfortunately this is difficult to add a test for because `lazy-load-images` leans on the `onload` event. We have no control over image loading in tests, so race conditions would be very likely.
2022-04-25 17:19:25 +01:00
06462631c4 DEV: Fix test hook placement (#16551)
It was incorrectly put inside the pretender block.
2022-04-25 15:07:55 +02:00
7f55c9c502 REFACTOR: add-archetype-class mixin (#16546) 2022-04-25 13:16:43 +02:00
794d2dabf6 DEV: Ensure ember-cli rake theme:qunit works with CSP enabled (#16541)
- Make proxy pass `x-forward...` headers, so that Rails can set the host/port correctly in the csp
- Make `testem.js` available on a route which is within the app's default CSP
2022-04-22 16:59:45 +01:00
e0d7431292 FIX: Use username for nested quotes (#16523)
There was an edge when a user re-quoted a nested quote that it would return an incorrect `full name` but the correct `username` for the original quote. This PR updates the logic to fall back to using the OP user's username. 

The complexity of the changes required to allow for full names to be displayed on nested quotes far outweighs how rare quoting nested quotes is.
2022-04-22 10:20:24 -05:00
127ba698a7 DEV: Allow running theme-qunit tests via testem (#16540)
This allows `QUNIT_EMBER_CLI=1 bin/rake theme:qunit[...]` to test themes using `testem` with Ember-CLI-generated assets
2022-04-22 15:04:01 +01:00
3010c5fd74 DEV: Fix loadScript() in ember-cli testem env (#16533)
The issue affected plugin-provided scripts.
2022-04-22 12:32:33 +02:00
70b69e318a DEV: Clean up loadScript() (#16537) 2022-04-22 11:53:39 +02:00
f2f1a4df62 DEV: Don't clean outlet and html caches twice (#16534)
They're already cleared after each test.
2022-04-22 11:17:18 +02:00
dba7a1d8ed FIX: Show footer on the categories page (#16538)
I removed that code in #16519 but it's still needed to display the footer on `/categories`.
2022-04-22 11:14:16 +02:00
9ffc19ec60 DEV: Don't leave loadScript tests hanging (#16536)
…when anything goes wrong. Let it move on instead of waiting for global test timeout.
2022-04-22 10:34:13 +02:00
3d62e335f7 FEATURE: Detect emoji from Emoji 14.0 (#16531) 2022-04-22 08:42:15 +02:00
3e4621c2cb FEATURE: Polymorphic bookmarks pt. 2 (lists, search) (#16335)
This pull request follows on from https://github.com/discourse/discourse/pull/16308. This one does the following:

* Changes `BookmarkQuery` to allow for querying more than just Post and Topic bookmarkables
* Introduces a `Bookmark.register_bookmarkable` method which requires a model, serializer, fields and preload includes for searching. These registered `Bookmarkable` types are then used when validating new bookmarks, and also when determining which serializer to use for the bookmark list. The `Post` and `Topic` bookmarkables are registered by default.
* Adds new specific types for Post and Topic bookmark serializers along with preloading of associations in `UserBookmarkList`
* Changes to the user bookmark list template to allow for more generic bookmarkable types alongside the Post and Topic ones which need to display in a particular way

All of these changes are gated behind the `use_polymorphic_bookmarks` site setting, apart from the .hbs changes where I have updated the original `UserBookmarkSerializer` with some stub methods.

Following this PR will be several plugin PRs (for assign, chat, encrypt) that will register their own bookmarkable types or otherwise alter the bookmark serializers in their own way, also gated behind `use_polymorphic_bookmarks`.

This commit also removes `BookmarkQuery.preloaded_custom_fields` and the functionality surrounding it. It was added in 0cd502a558 but only used by one plugin (discourse-assign) where it has since been removed, and is now used by no plugins. We don't need it anymore.
2022-04-22 08:23:42 +10:00
3daa45deaf FIX: replaces discourseComputed by computed (#16530)
This was causing unexpected behaviors on production builds. And also on firefox on local environnement, however the issues was slightly different.

- production chrome: colors don't load
- dev firefox: colors don't change when selecting a different color set
2022-04-21 21:56:08 +02:00
fc56bd36c9 DEV: Ensure a broken tag_group relation doesn't raise an error (#16529)
A category_required_tag_group should always have an associated tag_group. However, this is only enforced at the application layer, so it's technically possible for the database to include a category_required_tag_group without a matching tag_group.

Previously that situation would cause the whole site to go offline. With this change, it will cause some unexpected behavior, but the site serializer will not raise an error.
2022-04-21 18:18:35 +01:00
22a7905f2d DEV: Allow Ember CLI assets to be used by development Rails app (#16511)
Previously, accessing the Rails app directly in development mode would give you assets from our 'legacy' Ember asset pipeline. The only way to run with Ember CLI assets was to run ember-cli as a proxy. This was quite limiting when working on things which are bypassed when using the ember-cli proxy (e.g. changes to `application.html.erb`). Also, since `ember-auto-import` introduced chunking, visiting `/theme-qunit` under Ember CLI was failing to include all necessary chunks.

This commit teaches Sprockets about our Ember CLI assets so that they can be used in development mode, and are automatically collected up under `/public/assets` during `assets:precompile`. As a bonus, this allows us to remove all the custom manifest modification from `assets:precompile`.

The key changes are:
- Introduce a shared `EmberCli.enabled?` helper
- When ember-cli is enabled, add ember-cli `/dist/assets` as the top-priority Rails asset directory
- Have ember-cli output a `chunks.json` manifest, and teach `preload_script` to read it and append the correct chunks to their associated `afterFile`
- Remove most custom ember-cli logic from the `assets:precompile` step. Instead, rely on Rails to take care of pulling the 'precompiled' assets into the `public/assets` directory. Move the 'renaming' logic to runtime, so it can be used in development mode as well.
- Remove fingerprinting from `ember-cli-build`, and allow Rails to take care of things

Long-term, we may want to replace Sprockets with the lighter-weight Propshaft. The changes made in this commit have been made with that long-term goal in mind.

tldr: when you visit the rails app directly, you'll now be served the current ember-cli assets. To keep these up-to-date make sure either `ember serve`, or `ember build --watch` is running. If you really want to load the old non-ember-cli assets, then you should start the server with `EMBER_CLI_PROD_ASSETS=0`. (the legacy asset pipeline will be removed very soon)
2022-04-21 16:26:34 +01:00
e8f8a7fc91 FIX: showing icons on future-date-input options (#16527) 2022-04-21 18:13:45 +04:00
e5fb884695 FEATURE: Show prompt for required tag groups (#16458) 2022-04-21 13:13:52 +01:00
42bb629817 DEV: use the only source for time shortcut options on all date pickers (#16366) 2022-04-21 15:49:11 +04:00
53e484817e DEV: drop the unused invite-link-panel component and related unused code (#16435) 2022-04-21 14:32:17 +04:00