Commit Graph

19175 Commits

Author SHA1 Message Date
Jarek Radosz af7620cef8
FIX: In prod builds classes may not be "instancesof" EmberObject (#18137)
They do have CoreObject in their prototype chain.

Fixes the issue mentioned in https://github.com/discourse/discourse-chat/pull/1204
2022-08-30 17:36:20 +02:00
Jarek Radosz e33d694361
DEV: Stick to ipv4 when proxying testem requests (#18064)
`localhost` made it use ipv6, which didn't work (on macOS 13)
2022-08-30 13:38:55 +02:00
Alan Guo Xiang Tan c245b74398
FIX: Avoid leaking TopicTrackingState listeners due to sidebar (#18131)
In eb12daa7f8 when adding community
section support for anonymous users, we changed the `sectionLinks`
property into a getter method. This meant that if the getter method was
called again after the community section has been rendered, we would end
up reintializing the section links classes. As part of the
initialisation, some section links would setup a TopicTrackingState
onStateChange listener. However, the listener is only removed when the
entire community section is removed which resulted in us leaking the
onStateChange listeners.

This commit reverts the `sectionLinks` from being defined as a getter
method into a property which is only set once when the community section
is being constructor. Also, we changed it such that the community
section will register the listener instead of each section link since it
makes cleaning up much easier to reason about.

No tests have been added for this commit because the original bug is
not possible after this change and we already have an existing tests
ensuring that TopicTrackingState change listeners are cleaned up when
the community section is destroyed.

Internal ref: /t/73224
2022-08-30 11:39:32 +08:00
Osama Sayegh 417f156f6d
DEV: Use all unread notifications count for the count in document title (#18120)
When you receive a new notification, Discourse prepends a small count `(n)` to the tab title (i.e. `document.title`) if the tab is in the background to alert the user that they have a new notification. The count that's shown in the tab title should reflect the numbers shown on the notification bubbles above the user's avatar. Prior to the experimental user menu, there were 2 bubbles: a blue one which was removed once the user opened the menu and a green one that indicated high priority notifications and it was only removed when the user read all of their high priority notifications.

In the new experimental user menu, we no longer have the green bubble; everything is now combined (including flags/reviewables) into the blue one with no change to its behavior (i.e. it's removed once the user opens the menu). However, the logic that is responsible for updating the tab title hasn't been updated and still updates the tab title to include the count of the old green bubble. This commit updates the logic for the tab title count so that it only reflects the number on the blue bubble when the experimental user menu is enabled.
2022-08-30 05:37:03 +03:00
Keegan George a046f0306a
UX: Improve `max-height` value on toolbar popup menu (#18030)
* UX: Improve `max-height` value on toolbar popup menu

* UX: Popup menu based on new editor height property

* DEV: Update heights on resize

* DEV: Remove `--d-editor-height` property

* UX: Calculate max height based on composer type

* DEV: Remove event listener `willDestroyElement()` hook

* FIX: Remove unnecessary check and calculation

* DEV: Remove explicitly calling `updateHeightOnViewportResize()`

* UX: Update max-height

* UX: Different max-height values for reply/create

* DEV: Add comments for clarity

* DEV: Remove `updateHeightOnViewportResize()` event listener
2022-08-29 12:59:35 -07:00
David Taylor e16c8ea2e7
DEV: Support inline-hbs compilation in themes (#18112)
This commit makes a number of improvements to the DiscourseJsProcessor:

1. Remove dependence on the out-of-date Ember template compiler from the ember-rails gem; switch to modern template compiler
2. Refactor to make use of a proper module system with `define`/`require`
3. Introduce `babel-plugin-ember-template-compilation` to enable inline hbs compilation

The `mini-loader` is upgraded to support relative lookup and `require.has`, so that these new JS packages work correctly.
2022-08-29 19:53:42 +01:00
David Taylor 1bd1664ae0
DEV: Compile markdown-it-bundle with ember-cli (#18104)
We were already compiling the markdown bundle via ember-cli, but that version was only being used in the test environment. This commit improves the implementation, and updates the filename so it's also used in production.

This commit also
- Removes the vendored copy of `markdown-it.js` and fetches from node_modules instead
- Updates `pretty_text.rb` to remove the custom sprockets-manifest-parsing
- Removes `pretty-text-bundle.js`, which was only being used by `pretty_text.rb`
2022-08-29 19:11:59 +01:00
Penar Musaraj 4116bce902
DEV: Add A11Y-friendly dialog addon (#18028)
This adds a new framework for accessible dialogs that will eventually replace bootbox. Under the hood, it uses the a11y-dialog package and an in-repo Ember addon. See PR for usage details.
2022-08-29 13:59:57 -04:00
Andrei Prigorshnev c3a93597c1
FEATURE: show user status description on the mention popup (#18110) 2022-08-29 21:16:48 +04:00
Andrei Prigorshnev 007980fdaf
FEATURE: make user status on post streams live (#17903) 2022-08-29 19:33:50 +04:00
Bianca Nenciu f351200683
FIX: Show tag chooser if can_tag_pms (#18107)
The old logic did not make sense and hid the selector from regular users
even if they could tag PMs or showed selector for admins even if they
could not tag PMs.
2022-08-29 15:52:19 +03:00
Andrei Prigorshnev b6e0219a74
DEV: extract until date formatting in a library function (#18003) 2022-08-29 15:45:36 +04:00
Andrei Prigorshnev bbdffff41f
DEV: use the format-age helper on the DnD button on the new user menu (#18108) 2022-08-29 15:21:07 +04:00
David Taylor bad78bfdfb
FIX: Preload topic_list correctly for categories+latest (#18122)
The preload key was changed in e7a84948b9 but this location was missed. This caused an extra AJAX request and left the cached topic list in the PreloadStore, which would then be accidentally used when navigating to the next topic-list route.
2022-08-29 11:17:32 +01:00
Osama Sayegh e6dba65f18
DEV: Include reaction notifications in the likes tab (#18118) 2022-08-29 12:32:50 +08:00
Osama Sayegh 9a30e4929d
DEV: Ensure experimental user menu tabs don't go off screen (#18117) 2022-08-29 10:29:21 +08:00
Alan Guo Xiang Tan 48da481871
UX: Increase sidebar fontsize on mobile (#18100)
Font size was first increased in 9909d001c5 but regressed in
7a05a9d411
2022-08-29 10:27:58 +08:00
Alan Guo Xiang Tan d80535d78f
UX: Remove focus on hamburger icon after toggle (#18101) 2022-08-29 10:27:24 +08:00
Kris a0f402a957
DEV: plugin outlet for wizard checkboxes (#18113) 2022-08-26 17:03:30 -04:00
Kris faceb989bf
remove focus from sidebar header toggle click (#18088) 2022-08-26 16:00:01 -04:00
Isaac Janzen 614bf76c0b
DEV: update breadcrumbs outlet values (#18111) 2022-08-26 14:26:03 -05:00
Kris 000c4e1084
UX: fix styles for the wizard congrats step (#18105) 2022-08-26 12:29:40 -04:00
Joffrey JAFFEUX a780b42b03
FIX: prevents iOS software keyboard to hide sk body (#18102) 2022-08-26 14:52:04 +02:00
Gerhard Schlager ec93bca99e
UX: Remove confusing fallback locale warning (#18096) 2022-08-26 01:22:04 +02:00
Kris 9d9c48fcb8
DEV: allow custom composer heights in CSS (#18094) 2022-08-25 18:12:35 -04:00
Osama Sayegh 97f094e5ee
DEV: Apply model transformer API on more models (#18087)
This commit extends the plugin API introduced in 40fd82e2d1 to the `Bookmark` and `Notification` models. It also refactors the code that's responsible for loading items in the experimental menu to use `async`...`await` instead of `Promise`s.
2022-08-26 00:44:06 +03:00
Andrei Prigorshnev 14ab819c1d
FIX: remove unexpected scrollbar from the new user menu (#18089) 2022-08-25 15:18:26 -04:00
Andrei Prigorshnev 7be6f341a7
FEATURE: add the set user status button to the new user menu (#18079) 2022-08-25 18:14:42 +04:00
Osama Sayegh 40fd82e2d1
DEV: Add model transformer plugin API (#18081)
This API allows plugins to transform a list of model objects before they're rendered in the UI. At the moment, this API is limited to items/lists of the experimental user menu, but it may be extended in the future to other parts of the app.

Additional context can be found in https://github.com/discourse/discourse/pull/18046.
2022-08-25 15:41:58 +03:00
David Taylor 9ebebfb4cc
FIX: Load admin-specific JS when compiling via ember-cli (#18086)
The previous sprockets implementation was including admin-specific JS in the plugin's main JS file, which would be served to all users regardless of admin status. This commit achieves the same result under the ember-cli plugin asset compiler with one difference: the admin js is compiled into a separate file. That means that in future, we'll be able to make it loaded only for admins. For now though, it's loaded for everyone, just like before.
2022-08-25 11:36:02 +01:00
David Taylor e141208605
DEV: Compile plugin tests using ember-cli (#18074)
For now, `EMBER_CLI_PLUGIN_ASSETS` can be set to 0 to restore the old behavior. This option will be removed very soon.
2022-08-25 09:43:13 +01:00
Alan Guo Xiang Tan e9dac86cc0
FIX: Sidebar hamburger panel dropdown not working for anonymous (#18085)
We were incorrectly trying to render the sidebar sections for a logged
in user.
2022-08-25 16:29:06 +08:00
Alan Guo Xiang Tan 7f198bd975 DEV: Add dedicated translations for links in sidebar
We do not want to depend on existing translations which are used
elsewhere and can break the sidebar experience when changed.
2022-08-25 09:34:36 +08:00
Alan Guo Xiang Tan eb12daa7f8 DEV: Add sidebar community section for anonymous user 2022-08-25 09:34:36 +08:00
Kris e9e6ab688c
improve sidebar header sub-hovers (#18083) 2022-08-25 09:14:55 +08:00
Kris c5df47d5eb
minor sidebar scrollbar adjustments (#18080) 2022-08-24 15:46:01 -04:00
Kris 14770ed208
remove margin from sidebar sections (#18082) 2022-08-24 15:45:46 -04:00
Kris ba4a4d3297
UX: more apparent focus styles for sidebar headers (#18078) 2022-08-24 14:13:26 -04:00
Kris 03a599f457
UX: revert sidebar scrollbar repositioning (#18076) 2022-08-24 13:26:25 -04:00
David Taylor e7a84948b9
FIX: Avoid duplicate topic-list requests (#18073)
When preloading topic_list data we were giving it a 'preload key' which was loosely based on the parameters of the list. However, it did not include all parameters, and mismatches between client/server-side logic would cause the preloaded data to be ignored.

This commit simplifies things by using a single key for all topic_list preloading. This works on the assumption that "The first topic_list the JS app will load is the one which was preloaded". That assumption also existed to some extent in the old design, so we don't expect any regressions here.
2022-08-24 11:54:01 +01:00
David Taylor 52f9370bd6
DEV: Remove JQuery from `lib/keyboard-shortcuts.js` (#18056) 2022-08-24 10:22:51 +01:00
David Taylor b175513765
DEV: Enable ember-cli plugin assets by default (#18058)
For now, `EMBER_CLI_PLUGIN_ASSETS` can be set to 0 to restore the old behavior. This option will be removed very soon.
2022-08-24 10:20:38 +01:00
Krzysztof Kotlarek 7a58bd8827
FIX: hide sidebar toggle button when no sidebar (#18068)
When sidebar is not available (for example for anonymous user for sites which requires log in), toggle button should be hidden as well.
2022-08-24 12:09:40 +08:00
Kris 3068df4cea
UX: sidebar styling, spacing consistency, etc (#18059) 2022-08-24 09:33:15 +08:00
Krzysztof Kotlarek 6fb3610f4e
FIX: hide sidebar for anonymous when login required (#18065)
Recently anonymous sidebar was introduced, but it should be hidden when site requires users to authenticate.
2022-08-24 10:04:10 +10:00
Kris c89dc682c9
UX: hide background image in crawler view (#18054) 2022-08-23 18:10:21 -04:00
Jarek Radosz 87f5715878
DEV: Keep global state reset in a single place (#18049) 2022-08-23 21:09:37 +02:00
David Taylor 851bd78347
DEV: Enable jquery-integration runtime deprecation (#18057)
Omitting the flag from optional-features enables the runtime deprecation notice.

Also introduces `ember-jquery-legacy` which can be used to migrate to the new behaviour early. Details at https://deprecations.emberjs.com/v3.x/#toc_jquery-event

Core does not appear to make use of `originalEvent` in Ember event handlers. When searching for `originalEvent` there are some matches which relate to our pan-events mixin, but this is our own implementation and not affected by this deprecation.
2022-08-23 19:28:22 +01:00
David Taylor 1b180a3bdb
DEV: Remove JQuery from `components/topic-list.js` (#18048) 2022-08-23 19:27:54 +01:00
Jarek Radosz e21d2ac217
DEV: De-jQ sidebar tests (#18050)
And fix a typo
2022-08-23 18:30:07 +02:00
Jarek Radosz fd2d9a4ba3
Revert "UX: Hide chat image overflow (#18000)" (#18052)
This reverts commit e3108ded11.

Wrong selector, wrong repo 😆 Resubmitted as https://github.com/discourse/discourse-chat/pull/1196
2022-08-23 18:29:52 +02:00
Kris 0cb6b8b263
DEV: prevent class clash with user-field names (#18055) 2022-08-23 11:46:51 -04:00
David Taylor 3b1a46ff37
DEV: Skip loading plugin JS when running only core tests (#18047)
Plugins often change core behavior, and thereby cause core's tests to fail. In CI, we work around this problem by running core CI without any plugins loaded.

In development, the only option to safely run the core tests is to uninstall all plugins, which is clearly a bad developer experience. This commit aims to improve that experience.

The `qunit_skip_plugins=1` flag would previously prevent the plugin **tests** from running. This commit extends that flag to also affect the plugin's application JS.
2022-08-23 10:25:07 +01:00
Krzysztof Kotlarek 2d58996a3b
FEATURE: anonymous sidebar categories and tags (#18038)
Default sidebar tags for not authenticated users can be defined in admin panel. Otherwise, top 5 categories and tags are taken.

Optionally, if categories are set up in permanent order, then the first 5 categories are taken.
2022-08-23 16:20:46 +08:00
Alan Guo Xiang Tan e3501a207f
UX: Add badges section link to community section. (#18044)
We have a link to /badges in the old hamburger dropdown so maintaining
parity here.
2022-08-23 15:42:48 +08:00
Alan Guo Xiang Tan d390805e40
UX: Remove sidebar section header background highlight on focus (#18043) 2022-08-23 15:42:25 +08:00
Alan Guo Xiang Tan 2bcad12848
DEV: Reorganize user and anonymous sidebar files into respective folders (#18039)
This commit does not change any functionality
2022-08-23 13:17:59 +08:00
Arpit Jalan 5d44c31bfa
UX: do not show site header on wizard pages (#18037) 2022-08-23 10:17:37 +05:30
Jarek Radosz 4ca6717994 DEV: Use `.ember-application` instead of `#main`
`#main` in the test environment is replaced with `#ember-testing`, so this code would break. It never did only because we don't test these code paths 👀
2022-08-23 09:24:00 +08:00
Jarek Radosz 349f6e18f3 DEV: Correctly clear global exported variables 2022-08-23 09:21:28 +08:00
Bianca Nenciu b160331d41
FIX: Move show like logic to client side (#18025)
The logic was added in commit ec8306835d,
to show the like action even if the user could not like the post. It is
not necessary for this logic to be implemented on the server side.
2022-08-22 18:40:09 +03:00
Jarek Radosz 21abcfe5a7
FIX: Track native class deps in discourseComputed (#18023)
Co-authored-by: David Taylor <david@taylorhq.com>
2022-08-22 17:33:32 +02:00
Arpit Jalan b567cebffe
FIX: remove "--composer-height" style when composer is closed (#18022)
* FIX: remove "--composer-height" style when composer is closed

* fix typo

* fix linting
2022-08-22 17:41:56 +05:30
Bianca Nenciu ec8306835d
FIX: Improvements to like button for archived topics (#17951)
* FIX: Do not allow to remove like if topic is archived

* FIX: Always show like button

The like button used to be hidden if the topic was archived and it had
no likes. This commit changes that to always show the like button, but
with a not-allowed cursor if the topic is archived.
2022-08-22 14:58:02 +03:00
David Taylor 33a2624f09
DEV: Introduce flag for compiling Plugin JS with Ember CLI (#17965)
When `EMBER_CLI_PLUGIN_ASSETS=1`, plugin application JS will be compiled via Ember CLI. In this mode, the existing `register_asset` API will cause any registered JS files to be made available in `/plugins/{plugin-name}_extra.js`. These 'extra' files will be loaded immediately after the plugin app JS file, so this should not affect functionality.

Plugin compilation in Ember CLI is implemented as an addon, similar to the existing 'admin' addon. We bypass the normal Ember CLI compilation process (which would add the JS to the main app bundle), and reroute the addon Broccoli tree into a separate JS file per-plugin. Previously, Sprockets would add compiled templates directly to `Ember.TEMPLATES`. Under Ember CLI, they are compiled into es6 modules. Some new logic in `discourse-boot.js` takes care of remapping the new module names into the old-style `Ember.TEMPLATES`.

This change has been designed to be a like-for-like replacement of the old plugin compilation system, so we do not expect any breakage. Even so, the environment variable flag will allow us to test this in a range of environments before enabling it by default.

A manual silence implementation is added for the build-time `ember-glimmer.link-to.positional-arguments` deprecation while we work on a better story for plugins.
2022-08-22 09:56:39 +01:00
Alan Guo Xiang Tan 558e6a3ff4 Review feedback 2022-08-22 15:20:56 +08:00
Alan Guo Xiang Tan 3a5314c792 UX: Fix topic admin menu hidden on narrow screens
When there is not enough window width to display the admin menu on the
right, we display it on the left instead. Behavior is reversed on RTL
layout.

This commit also removes jQUery usage.
2022-08-22 15:20:56 +08:00
Alan Guo Xiang Tan a3565914a4 UX: Adjust scrollbar behaviour in sidebar
Vertical sidebar is only restricted to sidebar sections and not the
footer.
2022-08-22 14:09:39 +08:00
Joffrey JAFFEUX 4e3c688d65
DEV: implements `removeKeys(predicate)` in keyValueStore (#18019) 2022-08-21 19:19:25 +02:00
Jarek Radosz 9130565895
DEV: Async a bit more of Composer (#18013) 2022-08-21 12:11:10 +02:00
Jarek Radosz ff0f43014c
DEV: Remove widget-test helpers file (#18011) 2022-08-21 09:20:45 +02:00
Jarek Radosz 545bfcaca7
DEV: Simplify "Editing a post stages new content" test (#18007) 2022-08-21 09:20:26 +02:00
Jarek Radosz 870ff48470
DEV: Rework two composer actions tests (#18008) 2022-08-21 09:19:39 +02:00
Jarek Radosz d35ffe8361
DEV: `zoom` isn't used anymore (#18016) 2022-08-21 09:18:19 +02:00
Jarek Radosz 1284d746b0
DEV: Remove `progid:DXImageTransform` (#18017) 2022-08-21 09:17:58 +02:00
Jarek Radosz cb49fcad63
DEV: Clean up keyTrapper prototype override (#18018) 2022-08-21 09:17:33 +02:00
Jarek Radosz dc5dc78309
DEV: Use async and sinon.resolves instead of rsvp (#18001)
…in tests
2022-08-20 11:20:55 +02:00
Jarek Radosz e3108ded11
UX: Hide chat image overflow (#18000)
When there was a problem with an image the built-in frame would expand way outside the message.
2022-08-20 11:19:55 +02:00
Jarek Radosz 9b55c42eee
UX: Correctly center the reply-where modal (#17999)
And make the buttons actually full width, and use css vars.
2022-08-20 11:19:38 +02:00
Isaac Janzen 42385d020d
DEV: Add values to bread-crumbs-right plugin outlet (#18005) 2022-08-19 12:34:46 -05:00
Isaac Janzen ce30422d6c
DEV: Add select-kit option to hide values from preview (#18002)
* DEV: Add select-kit option to hide values from preview
2022-08-19 11:39:58 -05:00
Isaac Janzen 36f766399d
DEV: Add after-title-and-category plugin outlet (#18004) 2022-08-19 11:39:46 -05:00
Osama Sayegh 67bb0d8a55
DEV: Add profile tab to the experimental user menu (#17982)
This commit adds the profile tab to the experimental user menu. We're adding it to the user menu because it contains links/buttons that are not available anywhere else. We may remove the tab again if we find better places for those links/buttons, but for now it'll stay.

For more context on the experimental user menu, see https://github.com/discourse/discourse/pull/17379.
2022-08-19 13:02:11 +03:00
David Taylor 66376a6569
PERF: Minify admin and wizard JS bundles to match app (#17992)
This regressed when we switched these bundles to be compiled by ember-cli. Before/after sizes:

```
          before                  after
admin.js: 1370 KB (190 KB gz) --> 782 KB (125 KB gzipped)
wizard.js: 127 KB ( 22 KB gz) -->  68 KB ( 18 KB gzipped)
```
2022-08-19 08:35:00 +01:00
Alan Guo Xiang Tan 2d1e50911b DEV: Use button for sidebar section header
Buttons can be focused and action triggered via the enter key compared
to a span.
2022-08-19 10:21:36 +08:00
Martin Brennan 49a70a37f1
FIX: Remove last_unread_post excerpt logic for bookmarks (#17979)
The logic to determine what post excerpt to show for
a topic-level bookmark based on the last unread post
was complex and slow, so we decided to remove it and
always just use the first post excerpt.

This commit also fixes an issue where a couple of
instances of for_topic were missed when doing the
Bookmarkable refactors, so:

1. Clicking the topic bookmark link was not taking
   the user to the last unread post
2. When replying to a topic where there was a topic
   level bookmark with the auto delete preference
   of "on owner reply", we were not removing the
   bookmark from the UI correctly.

A test has been added for the former, the latter would
be quite time-consuming to test and not really worth
it considering it's quite an edge case UI bug.
2022-08-19 09:35:25 +10:00
David Taylor df9e546f5d
DEV: Abort qunit tests when clicking in the toolbar (#17989)
Ever opened `/tests`, immediately tried to change the config, and got frustrated that focus keeps getting stolen by the running tests? Worry no more - this commit will make the tests auto-abort when you click any of the input/dropdowns in the QUnit header. It's not perfect - abort will wait until the end of the currently running test, so sometimes focus will be stolen one more time. But it's still a lot better than having to manually find and click the abort button.
2022-08-18 23:32:38 +01:00
David Taylor c63580b226
DEV: Add hint when qunit assertion fails and app is unsettled (#17984) 2022-08-18 16:19:46 +01:00
Andrei Prigorshnev e49167b311
UX: Improve empty state copy on the activity/replies page (#17784) 2022-08-18 18:00:15 +04:00
Andrei Prigorshnev d7c1ff3116
UX: show blank page placeholder instead of the blue panel that says "No Activity" (#16293) 2022-08-18 17:24:52 +04:00
Jarek Radosz 6c46f4af71
UX: Don't shrink avatar/number box (#17985)
Fixes an issue where longer sidebar item text would squeeze the prefix element
2022-08-18 14:36:30 +02:00
Arpit Jalan 1e58bed4d2
DEV: add tests for --composer-height calculation (#17986)
Follow up for 2b43238973
2022-08-18 18:03:15 +05:30
Jarek Radosz 7b51ac418b
DEV: Asyncify most of Composer controller (#17974)
…and fix cases where we were breaking the promise/async chain (by not awaiting or not returning promises)
2022-08-18 13:58:08 +02:00
Arpit Jalan a252bbf3e8
FIX: show hide bootstrap mode notice in real time (#17981) 2022-08-18 17:09:33 +05:30
Andrei Prigorshnev be1b202fd6
FEATURE: show default custom date on time-shortcut-pickers (#17867) 2022-08-18 14:55:54 +04:00
Alan Guo Xiang Tan 5990842dd9 UX: Revamp styling of sidebar
The following changes are made in this commit:

1. Move caret icon in sidebar section header to the right.
1. Each row in sidebar takes the full width which enables us to do a
full width highlight on hover and when sidebar link is active.
1. Ensure each row in Sidebar is of the same height.

Internal refs: /t/70546, /t/72196, /t/71820
2022-08-18 16:14:49 +08:00
David Taylor 44c53cb3bf
DEV: Update internal `package.json` metadata (#17978)
These packages are not published anywhere - they only exist for organizational purposes within this repository. Even so, it makes sense for their metadata to match that of the top-level discourse/discourse repository.
2022-08-17 23:27:16 +01:00
David Taylor 72ea00d0cc
DEV: Add progress output in CI during ember-cli build (#17977)
By default, in CI environments, Ember CLI does not output anything between "building..." and "cleaning up". Depending on configuration and hardware, Discourse asset builds can take upwards of 60s, and so this lack of output can make the build feel 'stuck'.

This commit introduces an addon which checks for CI mode, and then outputs status information periodically. The logic is very similar to Ember CLI's non-CI progress output implementation (https://github.com/ember-cli/ember-cli/blob/04a38fda2c/lib/models/builder.js#L183-L185).
2022-08-17 22:39:52 +01:00
David Taylor e70bab16e0
DEV: Ensure custom ember-cli addons only output JS files (#17976)
Without this filter, a binary file (e.g. `.DS_Store`) in one of these addon directories will be concatenated into the output JS. Note that this filter is applied at the end of the build pipeline, so any hbs files have already been transpiled into `.js`.

This mirrors the filtering performed on the main application bundle by Ember CLI: https://github.com/ember-cli/ember-cli/blob/04a38fda2c/lib/broccoli/default-packager.js#L1255
2022-08-17 21:42:55 +01:00
Keegan George 602efedd81
UX: Make popup menu options scroll on limited screen height (#17973) 2022-08-17 13:42:25 -07:00
Jarek Radosz 665327f7a4
DEV: Clean up `loadDraft()` (#17969) 2022-08-17 20:43:35 +02:00
Arpit Jalan 2b43238973
FIX: set --composer-height when the composer is in collapsed state (#17968) 2022-08-17 20:51:09 +05:30
Jarek Radosz 83a975a28b
DEV: Await for all async MessageBus callbacks (#17966)
Should take care of yet another category of flaky tests
2022-08-17 12:44:48 +02:00
Osama Sayegh 129885c260
DEV: Add test for arrow keys navigation in the experimental user menu (#17961)
This test is extracted from the changes proposed in: https://github.com/discourse/discourse/pull/17379.
2022-08-17 11:51:29 +03:00
Alan Guo Xiang Tan 95c7cdab94 DEV: Template colocation for sidebar files
We can finally rely on template colocation in our app and we'll be
standarizing on that in the near future. However, I want to have sidebar
adopt this convention earlier.
2022-08-17 16:44:04 +08:00
Alan Guo Xiang Tan 0f0ea75a21
DEV: Display Sidebar template for anonymous user (#17962)
Setup the stage for the sidebar which will be shown to anonymous users.
2022-08-17 16:17:36 +08:00
Arpit Jalan 42c64abe15
FEATURE: open create invite modal from the bootstrap notice banner (#17960) 2022-08-17 13:11:09 +05:30
Alan Guo Xiang Tan 97a20d6d82
UX: Sort tags alphabetically in sidebar (#17959) 2022-08-17 14:47:29 +08:00
Alan Guo Xiang Tan f7ed09a02c
UX: Sort categories alphabetically in Sidebar (#17958) 2022-08-17 12:39:02 +08:00
Alan Guo Xiang Tan 4657110c35
UX: Make category section link icons consistent with Sidebar's interface (#17922)
Instead of relying on another help to generate the icons, we want to
rely on the interface for adding prefix icons. This ensures that prefix
icons are consistent across the section links in Sidebar
2022-08-17 09:40:43 +08:00
Penar Musaraj 2e09a88a29
A11Y: Accessible full-screen and minimize composer buttons (#17936) 2022-08-17 09:39:41 +08:00
Penar Musaraj c790b0305c
A11Y: Use button in `d-modal-cancel` component (#17938)
Fixes issue under User profile > Preferences > Security > Recently Used
devices > Cog icon. And cleans up the "reply where" modal as well.
2022-08-17 09:39:28 +08:00
Arpit Jalan f788c1b3e4
FIX: welcome topic title was not editable (#17950)
The topic title was not editable when composer was opened from the
welcome topic banner.
2022-08-16 21:27:40 +05:30
David Taylor 3e010bc88c
DEV: Ensure RenderGlimmer handles in-place component changes (#17946)
If a widget toggles between displaying two different RenderGlimmer instances, the Widget framework treats them as the same, and so `update()` is called rather than destroy/init. This commit detects this scenario and manually destroys/inits to ensure the correct component is being rendered.
2022-08-16 16:44:21 +01:00
Penar Musaraj e862373899
A11Y: Don't include aria on reply count `span` element (#17948) 2022-08-16 10:28:31 -04:00
Jarek Radosz 5c6f8d64f9
DEV: Use afterEach instead of try/finally (#17944)
Also removes _clearSnapshots calls, as those are already being reset in testCleanup
2022-08-16 10:49:09 +02:00
Jarek Radosz 53af30ec3f
DEV: Do the full cleanup after **every** test (#17943)
Previously the global state wasn't cleared in some cases leading to widespread test failures.
2022-08-16 10:48:32 +02:00
Jarek Radosz 655941b79c
DEV: Await for async helpers (#17942)
Fixes flaky tests. Also, a typo.
2022-08-16 10:48:17 +02:00
Jarek Radosz 7673899a6b
DEV: Remove commented-out code (#17945) 2022-08-16 10:46:26 +02:00
Alan Guo Xiang Tan 083c0074d6
DEV: Remove code that is not being used (#17941) 2022-08-16 13:58:43 +08:00
Alan Guo Xiang Tan 7a05a9d411
UX: Make Sidebar more consistent with user menu on mobile (#17940)
Before this commit, we carried custom code and styles for the sidebar on
mobile. This meant the look and feel of bringing up the sidebar on
mobile was very different from the user menu resulting in a very
inconsistent experience on mobile. Also, we could not leverage on the
existing swipe to close support on mobile.

In this commit, we made it such that the sidebar dropdown is always
rendered on mobile and made the interaction with the dropdown more
consistent with the user menu. There is also more parity with the old
hamburger dropdown when the experimental sidebar is disabled.
2022-08-16 13:45:32 +08:00
David Taylor e4de738f59
DEV: Introduce on-resize modifier and service (#17935)
This commit introduces a new `{{on-resize}}` modifier along with its companion `resize-observer` Service. These automatically take care of setting up the observer and handling cleanup.
2022-08-16 10:39:42 +08:00
Osama Sayegh 75599fb88e
DEV: Refactor new user menu files (#17879)
This commit includes the changes proposed in #17823. I've made these changes so that plugins that need to add tabs/lists with mixed item types - like the bookmarks tab that displays notifications and bookmarks - to the menu, don't have to write 2 templates like we currently do for the bookmarks/messages tabs (see user-menu/bookmark-notification-item.js that has been deleted in this commit).
2022-08-16 10:37:56 +08:00
Penar Musaraj b930f4886a
UX: Add flat text button styles and use in date/time cancel modal (#17892)
Also fixes an A11Y issue with the date/time cancel button.
2022-08-15 15:06:03 -04:00
Penar Musaraj 0d6fd1a606
A11Y: Add clearer focus states for date picker elements (#17890)
Affects date dropdowns, prev/next month arrows and day grid.
2022-08-15 14:50:07 -04:00
Jarek Radosz 5043669d05
DEV: Proxy `mobile_view` param to /bootstrap.json (#17934)
Without this it took an extra request for the setting to take in dev mode.

Also, append `preview_theme_id` only when present.
2022-08-15 18:56:38 +02:00
Jarek Radosz 2a1de963ac
DEV: Fix /logs in dev env (#17933)
The space character was missing in CSP between `_lr` and `logs` urls.
2022-08-15 18:56:23 +02:00
David Taylor 55f34c45c6
DEV: Modernise discovery controller query parameter construction (#17927)
Using `URLSearchParams` means that we don't have to manually encode/join strings
2022-08-15 17:20:44 +01:00
David Taylor 7067f13169
DEV: Silence resolver deprecations for now (#17931)
These are in widespread use, and upgrading themes/plugins right now would break their compatibility with the stable branch. These should be unsilenced for the release of 2.9.0 stable.
2022-08-15 16:11:46 +01:00
David Taylor 3ffc213fa9
FEATURE: Add safe-mode toggle to `/u/admin-login` (#17930)
Previously, this would require manually adding `?safe_mode=...` multiple times during the email-based login flow. `/u/admin-login` is often used when debugging a site, so it makes sense for this to be easier.

This commit introduces a new checkbox on the `/u/admin-login` screen. When checked, it'll set the safe_mode parameter on the `/email-login` link, and then pass it all the way through to the homepage redirect.
2022-08-15 15:30:07 +01:00
David Taylor 64a66cf82b
UX: Improve safe-mode usability (#17929)
- `no_custom` -> `no_themes` (history: before themes existed, we had a similar tool called 'customizations')
- `only_official` -> `no_unofficial_plugins` (matches format of `no_themes` and `no_plugins`, and makes it clear that this doesn't affect themes)
- `?safe_mode=no_themes%2C%no_plugins` -> `?safe_mode=no_themes,no_plugins` (the query portion of a URL does not require commas to be encoded. This is much nicer to read)
- If `no_plugins` is chosen from `/safe-mode` the URL generated will omit the superfluous `no_unofficial_plugins` flag
- Some tweaks to copy on `/safe-mode`
2022-08-15 15:15:15 +01:00
David Taylor a9e9adf253
DEV: Modernise rest adapter query parameter construction (#17925)
Using `URLSearchParams` means that we don't have to manually encode/join strings
2022-08-15 14:44:07 +01:00
David Taylor b6c6c803c2
DEV: Allow safe_mode and preview_theme_id to work via ember-cli proxy (#17928) 2022-08-15 14:43:43 +01:00
David Taylor 3d070b4a32
FIX: Ensure topic-list adapter never serializes `undefined` (#17924)
There was existing logic for this, but it was broken because the values were being run through `encodeURI` before checking its type. This commit takes the opportunity to modernise the function to use `URLSearchParams`, which means we no longer need to handle encoding/joining strings manually.

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2022-08-15 12:16:01 +01:00
David Taylor 6e5f08543e
DEV: Modernise navigation-item query parameter construction (#17926)
Using `URLSearchParams` means that we don't have to manually encode/join strings
2022-08-15 12:12:32 +01:00
David Taylor a185713e5f
DEV: Ensure date-time-input-range-test works in all timezones (#17923)
The test was failing when run outside of the UTC timezone
2022-08-15 11:28:30 +02:00
David Taylor 6cac35ca29 DEV: Update JS class sorting to match new lint rule 2022-08-15 09:28:31 +01:00
Krzysztof Kotlarek 8cd1340170
Revert "DEV: Experimental scroll sidebar to specific element event handler (#17727)" (#17920)
This reverts commit af912b4b0e.
2022-08-15 11:10:58 +08:00
Alan Guo Xiang Tan 6c13d82630
UX: Reduce font-size of sidebar section link suffix icon (#17919) 2022-08-15 10:34:30 +08:00
Alan Guo Xiang Tan 5a271fdc90
DEV: Skip flaky sidebar test (#17918)
The test is still useful and I intend to look at it in the future but
this is not the utmost priority at this point.

Follow-up to 68cefc9f9d
2022-08-15 10:33:59 +08:00
Penar Musaraj c66d544cf9
A11Y: Keep composer as focused element when dismissing Link modal via keyboard (#17893) 2022-08-15 09:37:19 +08:00
Penar Musaraj a32019d1e7
A11Y: add focus state for advanced search toggles (#17894)
Using `focus-visible` to ensure this only shows when navigating using
a keyboard.
2022-08-15 09:36:55 +08:00
Penar Musaraj 3fd929534c
A11Y: Improve group box hover highlight on dark schemes (#17895) 2022-08-15 09:36:28 +08:00
Jarek Radosz cac1608213
DEV: Fix `sidebar-hidden` localStorage value (#17915)
Previously ,`undefined` value for `sidebar-hidden` would mean "hide". Not it uses `true`.

Also, extract it into a const.
2022-08-15 09:35:01 +08:00
Jarek Radosz afaa2d5417
DEV: Fix localStorage test leakage (#17917)
We weren't clearing the store in all cases.
2022-08-15 09:33:25 +08:00
Arpit Jalan 3a21618e4e
FEATURE: allow wizard checkbox field to be disabled (#17916)
* FEATURE: allow wizard checkbox field to be disabled

* Changes per review feedback
2022-08-15 05:52:07 +05:30
Jarek Radosz 0be67cb513
DEV: Fix random test ordering (#17905)
And don't reorder failed tests when providing a seed - that was making failure debugging more difficult.
2022-08-15 02:04:44 +02:00
Jarek Radosz f25e779226
DEV: Prefer kvs over raw localStorage (#17907) 2022-08-14 17:31:49 +02:00
Jarek Radosz 92035cdc62
DEV: Change test localStorage prefix (#17906)
…to something more easily recognizable and less collision-prone
2022-08-14 17:31:37 +02:00
Andrei Prigorshnev fdfac8c720
UX: improve styles of the user status message component (#17904) 2022-08-14 18:55:54 +04:00