Commit Graph

17019 Commits

Author SHA1 Message Date
Bianca Nenciu d9484db718
FIX: Split link watched words from replace (#13196)
It was not clear that replace watched words can be used to replace text
with URLs. This introduces a new watched word type that makes it easier
to understand.
2021-06-02 15:36:49 +10:00
Martin Brennan e15c86e8c5
DEV: Topic tracking state improvements (#13218)
I merged this PR in yesterday, finally thinking this was done https://github.com/discourse/discourse/pull/12958 but then a wild performance regression occurred. These are the problem methods:

1aa20bd681/app/serializers/topic_tracking_state_serializer.rb (L13-L21)

Turns out date comparison is super expensive on the backend _as well as_ the frontend.

The fix was to just move the `treat_as_new_topic_start_date` into the SQL query rather than using the slower `UserOption#treat_as_new_topic_start_date` method in ruby. After this change, 1% of the total time is spent with the `created_in_new_period` comparison instead of ~20%.

----

History:

Original PR which had to be reverted **https://github.com/discourse/discourse/pull/12555**. See the description there for what this PR is achieving, plus below.

The issue with the original PR is addressed in 92ef54f402

If you went to the `x unread` link for a tag Chrome would freeze up and possibly crash, or eventually unfreeze after nearly 10 mins. Other routes for unread/new were similarly slow. From profiling the issue was the `sync` function of `topic-tracking-state.js`, which calls down to `isNew` which in turn calls `moment`, a change I had made in the PR above. The time it takes locally with ~1400 topics in the tracking state is 2.3 seconds.

To solve this issue, I have moved these calculations for "created in new period" and "unread not too old" into the tracking state serializer.

When I was looking at the profiler I also noticed this issue which was just compounding the problem. Every time we modify topic tracking state we recalculate the sidebar tracking/everything/tag counts. However this calls `forEachTracked` and `countTags` which can be quite expensive as they go through the whole tracking state (and were also calling the removed moment functions).

I added some logs and this was being called 30 times when navigating to a new /unread route because  `sync` is being called from `build-topic-route` (one for each topic loaded due to pagination). So I just added a debounce here and it makes things even faster.

Finally, I changed topic tracking state to use a Map so our counts of the state keys is faster (Maps have .size whereas objects you have to do Object.keys(obj) which is O(n).)

<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
2021-06-02 09:06:29 +10:00
Kris 9e5b8544a1
UX: Fix "last visit" line overlap in Chrome (#13232) 2021-06-01 17:33:29 -04:00
Gerhard Schlager 41ee5b7c86
FIX: Don't store translated trust level names in anonymous cache (#13224)
Refactors `TrustLevel` and moves translations from server to client

Additional changes:
  * "staff" and "admin" wasn't translatable in site settings
  * it replaces a concatenated string with a translation
  * uses translation for trust levels in users_by_trust_level report
  * adds a DB migration to rename keys of translation overrides affected by this commit
2021-06-01 22:11:48 +02:00
Robin Ward 409c8585e4
DEV: Remove `ember_jquery` in most situations (#13237)
In Ember CLI, the vendor bundler includes Ember/jQuery, so this brings
our app closer to that configuration.

We have a couple pages (Reset Password / Confirm New Email) where we need
`ember_jquery` without vendor so the file still exists for those cases.
2021-06-01 15:32:51 -04:00
Andrei Prigorshnev fd64268b0d
FIX: translation issue on the bookmark modal (#13231) 2021-06-01 19:13:58 +04:00
Jarek Radosz eb6a6446ee
FIX: Update non-Ember CLI ember-buffered-proxy (#13227)
This version matches the one we have in discourse/package.json.

Fixes an issue with saving topic name form w/o any changes.
2021-06-01 16:49:03 +02:00
Meghna 10c4fe5025
UX: fix PM header title alignment (#13223) 2021-06-01 14:36:56 +05:30
Joffrey JAFFEUX 1cd0424ccd
FEATURE: lets users favorite 2 badges to show on user-card (#13151) 2021-06-01 10:33:40 +02:00
Sam c5174e6982
FIX: MessageBus would stall after 20 minutes of inactivity (#13219)
Previous to this change we would switch off MessageBus updating after 20
minutes.

This ensures that when the user becomes present again we turn on long polling.

Without long polling updates can be delayed for minutes.
2021-06-01 12:23:51 +10:00
Krzysztof Kotlarek 73f11d568d
FEATURE: extend widget-dropdown to accept disabled option (#13020)
The widget should accept the disabled option.
In that case, CSS class "disabled".
In addition, after click dropdown will not be shown.

Also, the option to disable a specific value in a dropdown is included
2021-06-01 09:49:11 +10:00
Roman Rizzi 9ecd17b083
FIX: TL4 users cannot unhide posts. (#13211)
"PostsGuardian#can_unhide_post?" only returns true if the user is a staff member. We shouldn't let TL4 users see the Unhide post button.
2021-05-31 16:39:25 -03:00
Jarek Radosz 869518e3d2
FEATURE: Show all categories in composer (#13213)
…and just prioritize the current one, instead of hiding other categories.

Context: when you open the composer by clicking "New Topic" button when in a category, or by clicking "New Topic" in the share-popup, the category selector shows only the current category and its children (and "Uncategorized"). You can still find other categories, but you have to search by name.
This PR changes that, so you now can see all the categories in the dropdown, and those that are relevant (again: current, children and uncategorized) are displayed before all other categories.

tldr: don't make choosing other categories harder - make choosing relevant ones easier.
2021-05-31 20:50:23 +02:00
Jarek Radosz be92f4e959
UX: Fix the PM title icon alignment (#13214)
No extra margin to the left of the input, and the icon is one pixel lower.
2021-05-31 20:47:41 +02:00
Faizaan Gagan 8085fc6d39
DEV: add an option in user-chooser to list staged users (#13201)
* DEV: add an option in user-chooser to list staged users

* included rspec tests

* force boolean
2021-05-31 12:02:32 -04:00
Jarek Radosz 0922a69c62
UX: Align the bulk-select icon (#13210) 2021-05-31 15:27:59 +02:00
Jarek Radosz e06a206131
DEV: Remove `cache` option from `ajax()` (#13142)
1. It defaults to `cache: true` already
2. Setting it to `false` for non-GET request doesn't do anything
3. We were correcting `cache: false` GET requests to use `cache: true`

…so setting it to anything at all, for any type of request doesn't make sense (anymore)
2021-05-31 14:41:35 +02:00
Osama Sayegh b81b24dea2
Revert "DEV: Topic tracking state improvements (#12958)" (#13209)
This reverts commit 002c676344.

Perf regression, we will redo it.
2021-05-31 17:47:42 +10:00
Dan Ungureanu f3fdc7a6e8
FIX: Maintain notification order by priority (#13186)
When the client received a new notification, it prioritized only PM
notifications instead of maintaining the priority order. Later, the
check for missing notification deleted all notifications that were
in the wrong order because it could not match the IDs.

The correct order puts high_priority AND unread notifications first.
Low priority or read notifications (including high priority, but read
notifications) come after.
2021-05-31 09:27:13 +03:00
Martin Brennan 002c676344
DEV: Topic tracking state improvements (#12958)
Original PR which had to be reverted **https://github.com/discourse/discourse/pull/12555**. See the description there for what this PR is achieving, plus below.

The issue with the original PR is addressed in 92ef54f402

If you went to the `x unread` link for a tag Chrome would freeze up and possibly crash, or eventually unfreeze after nearly 10 mins. Other routes for unread/new were similarly slow. From profiling the issue was the `sync` function of `topic-tracking-state.js`, which calls down to `isNew` which in turn calls `moment`, a change I had made in the PR above. The time it takes locally with ~1400 topics in the tracking state is 2.3 seconds.

To solve this issue, I have moved these calculations for "created in new period" and "unread not too old" into the tracking state serializer.

When I was looking at the profiler I also noticed this issue which was just compounding the problem. Every time we modify topic tracking state we recalculate the sidebar tracking/everything/tag counts. However this calls `forEachTracked` and `countTags` which can be quite expensive as they go through the whole tracking state (and were also calling the removed moment functions).

I added some logs and this was being called 30 times when navigating to a new /unread route because  `sync` is being called from `build-topic-route` (one for each topic loaded due to pagination). So I just added a debounce here and it makes things even faster.

Finally, I changed topic tracking state to use a Map so our counts of the state keys is faster (Maps have .size whereas objects you have to do Object.keys(obj) which is O(n).)
2021-05-31 09:22:28 +10:00
Penar Musaraj 526dbc99b2
UX: Don't show reply prompt if current topic is closed (#13197)
A non-staff user cannot post to a closed topic, so we should not
show them the modal asking "Which topic do you want to reply to?"

This also fixes an issue I ran into while testing the above change, in
Ember CLI an error was being raised because related messages were being
set inside a computed property.
2021-05-28 13:47:51 -04:00
Jordan Vidrine d5e787fa89
UX: Change color of focus & hover on user menu tabs (#13195) 2021-05-28 12:24:04 -05:00
Martin Brennan 964da21817
FEATURE: Improve group email settings UI (#13083)
This overhauls the user interface for the group email settings management, aiming to make it a lot easier to test the settings entered and confirm they are correct before proceeding. We do this by forcing the user to test the settings before they can be saved to the database. It also includes some quality of life improvements around setting up IMAP and SMTP for our first supported provider, GMail. This PR does not remove the old group email config, that will come in a subsequent PR. This is related to https://meta.discourse.org/t/imap-support-for-group-inboxes/160588 so read that if you would like more backstory.

### UI

Both site settings of `enable_imap` and `enable_smtp` must be true to test this. You must enable SMTP first to enable IMAP.

You can prefill the SMTP settings with GMail configuration. To proceed with saving these settings you must test them, which is handled by the EmailSettingsValidator.

If there is an issue with the configuration or credentials a meaningful error message should be shown.

IMAP settings must also be validated when IMAP is enabled, before saving.

When saving IMAP, we fetch the mailboxes for that account and populate them. This mailbox must be selected and saved for IMAP to work (the feature acts as though it is disabled until the mailbox is selected and saved):

### Database & Backend

This adds several columns to the Groups table. The purpose of this change is to make it much more explicit that SMTP/IMAP is enabled for a group, rather than relying on settings not being null. Also included is an UPDATE query to backfill these columns. These columns are automatically filled when updating the group.

For GMail, we now filter the mailboxes returned. This is so users cannot use a mailbox like Sent or Trash for syncing, which would generally be disastrous.

There is a new group endpoint for testing email settings. This may be useful in the future for other places in our UI, at which point it can be extracted to a more generic endpoint or module to be included.
2021-05-28 09:28:18 +10:00
Robin Ward 2082abbb75
DEV: Add support for class properties in babel (#13189)
This allows us to start using JS classes instead of Ember's classes.
2021-05-27 16:13:14 -04:00
Bianca Nenciu efd6394cd8
FEATURE: Show an error message if regex is invalid (#13164)
The server cannot always determine when a watched word regular
expression is invalid and this commit implements the check on the client
side.
2021-05-27 19:42:43 +03:00
Bianca Nenciu b56e9ad656
DEV: Simplify watched word code (#13103)
* DEV: Use site setting instead

* DEV: Use .length instead of a different property

* DEV: Simplify watched word code
2021-05-27 19:20:26 +03:00
Penar Musaraj bcbb5b4dae
UX: Show grandparent category badge in sticky header on desktop (#13184) 2021-05-27 11:35:28 -04:00
Penar Musaraj 855e854cb8
DEV: Enable optional chaining in all contexts (#13180)
* Revert "FIX: We can't use `?.` yet (#13168)"
2021-05-27 09:56:35 -04:00
Dan Ungureanu 723d7de18c
Various GitHub Onebox improvements (#13163)
* FIX: Improve GitHub folder regexp in Onebox

It used to match any GitHub URL that was not matched by the other GitHub
Oneboxes and it did not do a good job at handling those. With this
change, the generic Onebox will handle the remaining URLs.

* FEATURE: Add Onebox for GitHub Actions

* FEATURE: Add Onebox for PR check runs

* FIX: Remove image from GitHub folder Oneboxes

It is a generic, auto-generated image which does not provide any value.

* DEV: Add tests

* FIX: Strip HTML comments from PR body
2021-05-27 12:38:42 +03:00
Sam 2f12c0f5bd
UX: alert screen readers when there is an issue saving a post (#13182)
* UX: alert screen readers when there is an issue saving a post

Adds a "alert" role to various popup-input-tips.

This means screen reader users can now tell why a post refuses to save.

Also ensures like icon in the "try the like button" has screen reader support
2021-05-27 18:19:05 +10:00
Penar Musaraj 1270c7ad15
UX: Twitter onebox layout adjustments (#13181) 2021-05-27 15:35:32 +10:00
Sam 489535e5c7
UX: unconditionally focus modals (#13179)
Previously auto focus would only work on modals that include buttons or
inputs.

To avoid a situation where information modals such as keyboard shortcuts
do not get focus, simply focus on the close button as a fallback.
2021-05-27 11:45:12 +10:00
Kris 34c5df2700
UX: Make search result styles more consistent (#13174) 2021-05-26 20:36:21 -04:00
Robin Ward 96fd202d9c
FIX: We can't use `?.` yet (#13168) 2021-05-26 17:30:27 -04:00
Robin Ward b9053c5e77
UX: Add auto focus to hamburger and user menu dropdowns (#13165) 2021-05-27 06:45:52 +10:00
Penar Musaraj ea68bab135
FIX: Close hyperlink modal on ESC key (#13166) 2021-05-26 15:11:12 -04:00
Penar Musaraj 787f989fb9
FIX: add body class and remove jQuery usage in footer-nav component (#13162) 2021-05-26 13:03:34 -04:00
Jarek Radosz 96f3f15f38
UX: Align list-controls & topic-title top margins (#13150) 2021-05-26 11:12:32 +02:00
David Taylor f25eda13fa
FIX: Make UI match server behavior for external-auth invites (#13113)
There are two methods which the server uses to verify an invite is being redeemed with a matching email:
  1) The email token, supplied via a `?t=` parameter
  2) The validity of the email, as provided by the auth provider

Only one of these needs to be true for the invite to be redeemed successfully on the server. The frontend logic was previously only checking (2). This commit updates the frontend logic to match the server.

This commit does not affect the invite redemption logic. It only affects the 'show' endpoint, and the UI.
2021-05-26 09:47:44 +01:00
Kris d0dfd0c73f
UX: Consistent padding on mobile/desktop `.wrap` (#13155) 2021-05-26 17:33:08 +10:00
Jarek Radosz 494fe7f2f6
UX: Adjust list and onebox margins (#13131)
Lists – made the indent smaller (helps on mobile), added vertical margin
Onebox – added top margin
2021-05-25 23:52:33 -04:00
Kris f78fa76847
UX: change categories page dropdown to a wrench (#13154) 2021-05-26 12:53:52 +10:00
Sam 759abb3206
UX: Improve navigation on topic lists for screen readers (#13153)
Previously we had no role set for various topic links, nor did we have any
headers.

This teaches screen readers that topic links in topic lists are to be treated
as H2. We opted for this less radical change cause a change of the element
type would probably result in many broken themes.

Confirmed on NVDA you can very quickly breeze through topic lists now. Minor
edge case is pinned topics which can be a bit annoying due to multiple links.
2021-05-26 12:53:14 +10:00
Sam 293877237d
UX: provide a region for various topic actions (#13152)
This makes it much easier to reply to topics / bookmark topics and so on

Previously topic buttons had no region
2021-05-26 11:05:35 +10:00
Dan Ungureanu 197e3f24ce
FEATURE: Show stale reviewable to other clients (#13114)
The previous commits removed reviewables leading to a bad user
experience. This commit updates the status, replaces actions with a
message and greys out the reviewable.
2021-05-26 09:47:35 +10:00
David Taylor 8c83803109
DEV: Remove unused `disabled_plugins` checks (#13144)
We now bundle Javascript for each theme/plugin separately, and only ship bundles for enabled plugins to the client. Therefore, these disabled_plugins checks are now redundant, and can be removed.
2021-05-26 09:44:58 +10:00
Martin Brennan 7a79bd7da3
FEATURE: Allow selective dismissal of new and unread topics (#12976)
This PR improves the UI of bulk select so that its context is applied to the Dismiss Unread and Dismiss New buttons. Regular users (not just staff) are now able to use topic bulk selection on the /new and /unread routes to perform these dismiss actions more selectively.

For Dismiss Unread, there is a new count in the text of the button and in the modal when one or more topic is selected with the bulk select checkboxes.

For Dismiss New, there is a count in the button text, and we have added functionality to the server side to accept an array of topic ids to dismiss new for, instead of always having to dismiss all new, the same as the bulk dismiss unread functionality. To clean things up, the `DismissTopics` service has been rolled into the `TopicsBulkAction` service.

We now also show the top Dismiss/Dismiss New button based on whether the bottom one is in the viewport, not just based on the topic count.
2021-05-26 09:38:46 +10:00
Roman Rizzi de0f2b9546
UX: Users can postpone discobot's tutorial. (#13060) 2021-05-25 16:30:16 -07:00
Jordan Vidrine b0b23a969f
UX: Search result link title color change (#13149) 2021-05-26 08:08:34 +10:00
Nolan Darilek 549e100d8c
A11Y: Add heading role for post titles. (#13143)
Not all screen readers treat articles as navigable roles when moving between landmarks. To help with this, we use a `heading` role on the title, with an arbitrary depth of 2 chosen as to not conflict with the main `<h1/>`. Because ARIA roles are used, this change should be entirely non-visual.

While this introduces minor navigation challenges in posts where headers are included, the vast majority of posts don't, and as screen reader users, we're used to mixed headers in longer-form content.
2021-05-25 22:43:09 +02:00
Robin Ward 681a129ec0
FIX: Better focus support for modals (#13147) 2021-05-25 16:33:46 -04:00
Penar Musaraj 452ea7e32e
FIX: Properly break overflowing long links in topic map (#13146) 2021-05-25 15:43:58 -04:00
Mark VanLandingham 72950e051c
Add category breadcrumbs to edit category page (#13126) 2021-05-25 13:40:11 -05:00
Jarek Radosz 3f5d868219
DEV: Add peer dependencies (#13132)
Fixes yarn warnings.

* DEV: Add `eslint` peer dependency
* DEV: Add `@babel/core` peer dependency
* DEV: `npx yarn-deduplicate` & `yarn`
2021-05-25 18:39:40 +02:00
Jarek Radosz 9b9b601e2f
DEV: Remove unused `offscreen-content` (#13133)
Looks like a vestige of Ember 1.x?
2021-05-25 18:39:06 +02:00
Jarek Radosz 61cf34c09d
DEV: Don't resetSite() more often than needed (#13138)
Avoid calling resetSite() twice per test in certain situations.

Included:
* DEV: Import `exists` helper
2021-05-25 18:38:41 +02:00
Jarek Radosz 51b360916c
DEV: Use `import { inject as controller}` Ember idiom (#13140) 2021-05-25 18:37:32 +02:00
Jarek Radosz 5c3c2b8d31
FEATURE: Change "Preformatted text" shortcut (#13137)
Cmd/Ctrl+Shift+C was conflicting with browsers' "inspect element" keyboard shortcuts. Cmd/Ctrl-E was chosen because it's the same one that GitHub is now using: https://github.blog/changelog/2021-04-09-new-codeblock-shortcut/
2021-05-25 15:57:29 +02:00
Sam 6e2ecf40c7
UX: add ARIA region role to posts (#13130)
NVDA does not detect HTML5 articles as regions. This explicitly sets a
region with an aria-label denoting post numbers making it much easier to
know where you are in a topic.

Note role: article which is more semantically correct is not respected by
NVDA d/D shortcut, hence the much more generic "region" role.
2021-05-25 20:58:13 +10:00
Andrei Prigorshnev f21d50ebb6
UX: show Update button instead of Enable button when slow mode is already enabled (#13077)
When slow mode is enabled it's possible to open the slow mode dialog again to disable it or to update slow mode settings. The problem is that in this case, the button for saving still has the label "Enable" which is confusing.

This changes the text on the button from "Enable" to "Update" when slow mode is already enabled.
2021-05-25 13:33:39 +04:00
Jeff Atwood 50926f6143
FIX: Simplify post and topic deletion language (#13128)
Based on feedback from Matt Haughey, we don't need to use so many words when describing a deleted topic or post.

Co-authored-by: Martin Brennan <martin@discourse.org>
2021-05-25 12:04:10 +10:00
Jeff Wong b66802ccf1
DEV: add plugin hook to add topic participant classes (#13125)
Allow plugins to add custom css classes to topic participants
2021-05-24 12:33:21 -07:00
Kris 567f9caf75
A11Y: Fix post control and user-menu focus styles (#13118) 2021-05-24 18:10:01 +10:00
Andrei Prigorshnev a5dd24c445
DEV: fix warnings 'Hbs template must be compiled and not a string' in tests (#13116)
These warnings appeared only when running tests using Ember CLI.
2021-05-21 19:58:18 +04:00
Bianca Nenciu f700f3ef00
FEATURE: Support tag and replace in watched words in test modal (#13100)
The modal showed only the matches, without the replacement or tags.
2021-05-21 17:50:24 +03:00
Andrei Prigorshnev 0df6b0bc47
FIX: slow mode dialog doesn't remember Enabled Until value (#13076)
If reload a page after enabling slow mode and open the slow mode dialog again it would show a slow mode interval but wouldn't show Enabled Until value. This PR fixes it.
2021-05-21 18:13:14 +04:00
Bianca Nenciu 38af28d58b
FIX: Allow add email to group if user can invite (#13097)
It used to allow adding email addresses to a group even if invites were
disabled for the site. This does not allow user to input email address
if they cannot invite.

The second thing this commit improves is the message that is displayed
to the user when they hit the invite rate limit.
2021-05-21 11:34:17 +03:00
Josh Soref 13d40ead97
DEV: Correct spelling mistakes in comments 2021-05-21 13:37:17 +10:00
Josh Soref 59097b207f
DEV: Correct typos and spelling mistakes (#12812)
Over the years we accrued many spelling mistakes in the code base. 

This PR attempts to fix spelling mistakes and typos in all areas of the code that are extremely safe to change 

- comments
- test descriptions
- other low risk areas
2021-05-21 11:43:47 +10:00
Joe 6421fabb02
UX: Improve positioning of controls in lightboxes (#13108)
This commit fixes an issue where controls scroll in lightboxes with large images (after zooming in)

Before:

05024730b3.mp4

Notice how controls like the close button, the next and previous button, and the image metadata also scroll? This is an undesired behavior.

After:

8047bab735.mp4

This is the desired behavior; only the image should scroll.

The changes in this PR apply to both desktop and mobile.
2021-05-21 09:18:22 +08:00
Robin Ward e1b99d3cad
FIX: Review Queue Query parameters were not refreshing in Ember CLI builds (#13101)
The problem was we were setting the properties then immediately calling
`refreshRoute` which was being executed before the properties were
settled via the runloop.
2021-05-20 14:00:25 -04:00
Kris db7038e6c2
UX: Fix theme upload width, remove class clash, prettier (#13071)
* UX: fix width & theme upload modal class clash

* remove unneeded class

* unprettier hbs

* add back unicode emoji

* add newline
2021-05-20 17:10:40 +10:00
Kris f1b14a7f71
FIX: Specificity and other fixes for WCAG colors (#13082) 2021-05-20 16:28:03 +10:00
Andrei Prigorshnev 28e201f391
DEV: add timezone to user fixtures (#13095) 2021-05-20 16:06:38 +10:00
Kris a532e64389
DEV: Some select-box headers don't need a class (#12992)
* DEV: Some select-box headers don't need a class

* remove duplicate class
2021-05-20 16:00:45 +10:00
Andrei Prigorshnev 6d3c975519
FIX: backtracking re-render" assertion in future-date-input (#13075)
> Backtracking re-render refers to a scenario where, in the middle of the rendering process, you have modified something that has already been rendered.

See more details from the Ember team here https://github.com/emberjs/ember.js/issues/13948.

We call _updateInput from init. _updateInput triggers onChangeInput which mutates a date that was given to future-date-input just a moment ago and a rendering cycle wasn't finished yet.
2021-05-19 14:01:23 +04:00
Arpit Jalan f96f534f3e
FIX: do not include contact url & email in client site settings payload (#13004) 2021-05-19 16:15:24 +10:00
Gerhard Schlager 0eecf8aaa5
Fix typo (#13087) 2021-05-19 11:09:50 +10:00
Joffrey JAFFEUX c78f32a9a1
FIX: removes legacy Ember.keys usage causing a crash (#13085)
The crash:

```
Uncaught TypeError: Ember.keys is not a function
```

Repro:

- visit home page
- click new topic
- navigate to your messages by clicking your avatar (top right), then enveloppe icon, and finally the bottom chevron
- click New Message
- click cancel in the composer, it should crash
2021-05-18 12:23:41 +02:00
Bianca Nenciu c1dfd76658
FIX: Make replace watched words work with wildcard (#13084)
Watched words are always regular expressions, despite watched_words_
_regular_expressions being enabled or not. Internally, wildcard
characters are replaced with a regular expression that matches any non
whitespace character.
2021-05-18 12:09:47 +03:00
Robin Ward a21700a444
FIX: Previewing themes didn't work in Ember CLI (#13078)
This is two fixes:

1. Ember CLI's proxy did not support 3xx redirects so a redirect was
   failing.

2. We were not passing query parameters to the `bootstrap.json` endpoint
   to correctly handle previewing themes (and other occasional options.)
2021-05-17 14:51:36 -04:00
Roman Rizzi 8801a27cc6
FIX: Automatically load more reviewable items. (#13069)
If you finished reviewing the initially loaded items, and there're more in the queue, load them.

Also, when fast-tracking the pending items updates, use the reviewable_count returned by the perform result. Calling "result.reviewable_count" returns undefines.
2021-05-14 15:06:34 -03:00
Robin Ward 32d6d8308c
FIX: Allow `file-change` events soon after reloading (#13065)
This patch remembers the last id for the `file-change` event and uses it
to initialize the client side watcher. This should help fix the issue
where styles are not reloaded client side if the browser refreshed.
2021-05-14 12:36:53 -04:00
Dan Ungureanu 034a0493e3
FIX: Delete unconfirmed emails first if available (#13046)
Users can end up with the same email both as secondary and unconfirmed.
When they tried to delete the unconfirmed ones, the secondary one was
deleted.
2021-05-13 16:14:00 +10:00
Jarek Radosz 582ec198d8
DEV: Update ember-cli across all in-repo addons (#13048)
…to match the version used in the app.
2021-05-12 21:49:55 +02:00
Robin Ward 3d7abad949
FIX: We should include resumable.js in the admin bundle (#13049)
Normally we'd use `ember-auto-import` for this, but it's not run on
our admin tree due to the quirky way we load it conditionally.
Instead we'll append it at the bottom like our Rails app does.
2021-05-12 13:44:24 -04:00
Jarek Radosz f08f6118f2
FIX: Make truth-helpers work in Ember CLI (#13044)
The addon wasn't included at all 😃
2021-05-12 17:52:36 +02:00
Jarek Radosz b24270845f
DEV: Update chart.js from 2.9.3 to 2.9.4 (#13026)
Release notes: https://github.com/chartjs/Chart.js/releases/tag/v2.9.4
2021-05-12 17:28:16 +02:00
zacholas e8d0c122e3
added a plugin outlet for above the discovery list controls (#13042) 2021-05-12 11:21:32 -04:00
Penar Musaraj b0d66b4b2f
FIX: Support pausing inline animated images (#13033) 2021-05-12 09:49:04 -04:00
Penar Musaraj f9bb6399e0
DEV: Remove SCSS color vars fallbacks (#13035)
They are no longer needed.
2021-05-12 08:56:15 -04:00
Dan Ungureanu 60be1556fc
FIX: Various invite system fixes (#13003)
* FIX: Ensure the same email cannot be invited twice

When creating a new invite with a duplicated email, the old invite will
be updated and returned. When updating an invite with a duplicated email
address, an error will be returned.

* FIX: not Ember helper does not exist

* FIX: Sync can_invite_to_forum? and can_invite_to?

The two methods should perform the same basic set of checks, such as
check must_approve_users site setting.

Ideally, one of the methods would call the other one or be merged and
that will happen in the future.

* FIX: Show invite to group if user is group owner
2021-05-12 13:06:39 +03:00
Rafael dos Santos Silva 63ca9e0650
DEV: Add cleanup methods for composer extension hooks that tests can use (#13034) 2021-05-11 17:29:24 -03:00
Rafael dos Santos Silva 2f60309b13
FEATURE: New API hook to allow for client side upload transforms (#12990) 2021-05-11 12:20:28 -03:00
Penar Musaraj e8f6e00dc9
DEV: Show warning in admin UI for core SCSS color vars (#12984)
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-05-11 09:01:06 -04:00
Andrei Prigorshnev 0a4cb65020
DEV: Fix some deprecation warnings in tests
- Import `exists()` instead of using the global function (#13010)
2021-05-11 14:04:33 +04:00
Osama Sayegh 9ec5f39764
DEV: Clear `NavItem.customNavItemHrefs` between tests (#13025)
Identical callbacks can pile up during tests and cause all sort of weird problems that are difficult to debug. This commit clears registered callbacks after each test.
2021-05-11 12:54:37 +03:00
Jarek Radosz a7a2887df0
DEV: Remove unnecessary yarn.lock files (#13001)
All in-repo ember addons share the same yarn.lock in the yarn workspace: `/app/assets/javascripts/yarn.lock`
2021-05-11 11:15:07 +02:00
Blake Erickson 37812b8e35
Revert "DEV: Drop old IE11 intersection-observer references" (#13017)
This reverts commit 7360a0f70f.

iOS still wants this sometimes. Probably best to revert for now and we can
always remove this again later.

See: https://meta.discourse.org/t/189799/11?u=blake
2021-05-10 17:47:09 -06:00
Jeff Wong d61573fb1b
FIX: ember-cli proxy subfolder fix (#12996)
* FIX: ember-cli proxy subfolder fix

* REFACTOR: put rootURL setup in environment, update baseURL logic for subfolder

Correctly have ember understand and parse relative_url_root and use it in
the dev server
2021-05-10 10:02:33 -07:00
Penar Musaraj 81616fbdc4
DEV: Fix flaky d-editor test (#13005) 2021-05-10 13:00:18 -04:00
Martin Brennan aaa034786a
FIX: Remove auto-route from topic-link (#12999)
This was needed to fix a bookmark back button issue but it
broke category topic links, causing a full reload. Now it appears
something has changed in core and this is no longer necessary for
the bookmark back button to work, so I am removing it again.
2021-05-10 11:09:55 +10:00
Kris f002c58a30
DEV: Buttons were missing btn-default classes (#12991) 2021-05-08 11:45:18 -04:00
Robin Ward 225c0d2d96
FIX: Core templates should never overwrite theme/plugins (#12988)
This happened in Ember CLI due to a different script load order.
2021-05-07 14:41:06 -04:00
Jarek Radosz efe055c273
DEV: Fix tags/show template lint errors (#12982)
Uncovered in #12981
2021-05-07 16:53:42 +02:00
Robin Ward b7d6cc5b1c
FIX: `crypto.randomUUID` is only available in newer node releases (#12983)
Also, we should properly surface the error instead of saying it was
`bootstrap.json`
2021-05-07 09:59:45 -04:00
Sam 972347bc98
DEV: show profiler badge for first request (#12978)
In development using ember cli we were missing timings for the first req
2021-05-07 08:49:47 -04:00
Kris f61d430566
UX: Improve category controls on smallest devices (#12945) 2021-05-06 17:51:55 -04:00
Bianca Nenciu ecc3c404a0
FIX: Cache missing inline oneboxes (#12953)
* FIX: Cache missing inline oneboxes

Some inline oneboxes were not cached when the server did not return an
answer for an URL and the queried URL and the absolute URL were
different.

For example, if user typed www.example.com, the client asked the server
for http://www.example.com and if the server returned an empty response,
then the client would keep requesting an inline onebox everytime the
composer changed.

In other words, the key used for reading (the absolute URL) and the one
used for writing (the URL as typed by the user) were not the same when
the server returned an empty response.

* DEV: Check cache before making request

There is another cache check in PrettyText, but that is not enough if
multiple requests are pending. This problem was made obvious in tests,
but can happen for users with slow connections.
2021-05-06 19:08:04 +03:00
Robin Ward 1bc6fdd41d
Add Mini Profiler support to Ember CLI (#12970) 2021-05-06 11:54:17 -04:00
Penar Musaraj 82ecd9fdd5
DEV: tiny refactor in watched words (#12969) 2021-05-06 11:37:05 -04:00
Penar Musaraj b61d4663ec
FIX: Prevent infinite loop when replacing watched words (#12967) 2021-05-06 11:06:25 -04:00
Dan Ungureanu 17efce9023
FEATURE: Allow sending a message with invite (#12892)
* FEATURE: Allow sending a message with invite

It used to be a staff-only feature and this commit makes it available
to everyone who can invite.

* FIX: Inviting to topic uses another email template

This used to be the case, but the extra parameter was lost when we
switched to the new modal.
2021-05-06 10:16:42 +03:00
Penar Musaraj aec52ce043
UX: Admin watched words UI tweaks (#12956) 2021-05-06 12:40:07 +10:00
Martin Brennan 72648dd576
FIX: Base topic details message on current category and tag tracking state (#12937)
The user may have changed their category or tag tracking settings since a topic was tracked/watched based on those settings in the past. In that case we need to alter the reason message we show them otherwise it is very confusing for the end user to be told they are tracking a topic because of a category, when they are no longer tracking that category.

For example: "You will see a count of new replies because you are tracking this category." becomes: "You will see a count of new replies because you were tracking this category in the past."

To do this, it was necessary to add tag and category tracking info to current user serializer. I improved the serializer code so it only does 3 SQL queries instead of 9 to get the tracking information for tags and categories for the current user.
2021-05-06 09:14:07 +10:00
Robin Ward c792c2b5fe
FIX: `{{ace-editor}}` was buggy in Ember CLI release (#12952) 2021-05-05 13:45:52 -04:00
Roman Rizzi c8f34db648
FIX: Use the no-sandbox flag when running Ember CLI tests. (#12951)
Without this flag we get "Error: Browser exited unexpectedly" when trying to run tests.
2021-05-05 14:02:26 -03:00
Blake Erickson 1b02dce594
DEV: Drop old IE11 intersection-observer references (#12942)
It's been awhile since we have supported IE11 so it should be safe to remove
IntersectionObserver now.

From a TODO task in this repo:
> drop when we eventually drop IE11

Announcement of when we removed IE11 support:

https://meta.discourse.org/t/137984/40?u=blake
2021-05-04 17:54:54 -06:00
Martin Brennan 657370b56c
FIX: Pressing back from topic in bookmark list takes user to / (#12936)
See: https://meta.discourse.org/t/navigating-back-to-bookmarks/188912/4

Instead of taking the user back to the bookmark list after selecting
a topic and navigating back, the user was navigated back to the page
before that. This is because the topic-link component was missing
the data-auto-route attribute which tells the intercept-click library
not to use DiscourseURL.routeTo to handle the transition (so it is just
handled internally by Ember)
2021-05-05 09:00:21 +10:00
Kris f57878f20f
FEATURE: Add more class names to latest-topic-list-item (#12933) 2021-05-04 16:40:42 -04:00
Andrei Prigorshnev 599327658c
FIX: temporarily skip flaky future-date-input tests (#12941) 2021-05-04 17:18:58 +04:00
Grayden 61ad959212
UX: Allow saving with cmd+s/ctrl+s with Ace editor (#12674)
When editing the files for a theme in the admin dashboard, typing "cmd+s" (a common key-binding to save in most text editors) used to engage the browser's default "save page" dialogue.

This commit adds a key-binding to the ace editor that saves the file.

Now, the "cmd+s" (and "ctrl+s" for windows) key-binding does the same action as the save button.
2021-05-04 12:56:10 +01:00
Andrei Prigorshnev 338740c385
UX: hide the list of file extensions on the upload dialog (#12836) 2021-05-04 15:16:00 +04:00
Vinoth Kannan 167bbb259f
UX: add CSS classes on body tag based on topic statuses. (#12729)
This commit will add CSS classes like `unlisted`, `pinned`, and `unpinned` on the body tag.

* DEV: we no longer using the `categoryClass` & `tagClasses` methods.
* Update app/assets/javascripts/discourse/app/components/add-topic-status-classes.js

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2021-05-04 11:07:54 +05:30
Hariraj Venkatesan 0ac9abe59e
FIX: show required only when full name is required and lint fix (#12916) 2021-05-04 12:58:26 +10:00
Penar Musaraj 10d229ff71
Revert "FIX: excludes .svg-as-img from JS sizing (#12906)" (#12931)
This reverts commit 2f0205e5c8.
2021-05-03 14:40:18 -04:00
Penar Musaraj 9bc126949e
DEV: Support referencing public images in plugins in SCSS (#12930) 2021-05-03 14:40:02 -04:00
Kris 8ca6202d81
FIX: tag control styles should apply to desktop (#12919) 2021-05-03 13:57:10 -04:00
Kris 3731d3c772
UX: anticipate anchor link hover (#12920) 2021-05-03 13:56:58 -04:00
webdirektindia 6c276765c2
Adding composer-after-composer-editor plugin-outlet on the composer template (#12914)
* Adding after-groups-index-container plugin-outlet on the groups index template

* Update app/assets/javascripts/discourse/app/templates/groups/index.hbs

Co-authored-by: Régis Hanol <regis@hanol.fr>

* Adding composer-after-composer-editor plugin-outlet on the composer template

* Update composer.hbs

Co-authored-by: Régis Hanol <regis@hanol.fr>
2021-05-03 11:27:09 -04:00
Joffrey JAFFEUX 286b6916af
UX: refactor security modals (#12870)
- better form
- uses d-footer
- ensure buttons have the same height

Note that to achieve same height for btn without text, I made the choice to go for a minimum height which should work in most cases.
2021-05-03 09:22:33 +02:00
Andrei Prigorshnev e7de943b5d
FIX: hide "Next Week" in future-date-input on Sundays (#12918) 2021-05-03 09:22:05 +02:00
Penar Musaraj 7b5f31ff04
FIX: Wizard locale change wasn't applying to some elements (#12915) 2021-04-30 12:14:16 -04:00
Jordan Vidrine ffa78b5c26
FIX: Update max-width of staff log cells (#12903)
This commit adjusts the max-width of cells in the staff logs to make up for the new word wrap rules in place.
2021-04-30 10:58:17 -05:00
Penar Musaraj 28cefb666a
FIX: light color scheme picker should default to user selection (#12913)
Fixes a bug in user preferences > interface, the light scheme dropdown
was defaulting to "Theme Default" even when the user had selected a
different scheme.
2021-04-30 11:31:01 -04:00
David Taylor c1f969135f
DEV: Update pushState and replaceState development patches (#12863)
This updates the preview_theme_id preservation logic to use more recent, robust, browser APIs. It also adds support for preserving the `?pp=async-flamegraph` parameter which is proposed in https://github.com/MiniProfiler/rack-mini-profiler/pull/494
2021-04-30 11:28:47 +01:00
Osama Sayegh 486550c6fe
DEV: Arrange theme QUnit dependencies in the right order (#12907) 2021-04-30 13:28:33 +03:00
Osama Sayegh 19ee38b78a
DEV: Fix `BAD CSRF` errors for admin POST requests when on Ember CLI (#12908) 2021-04-30 13:26:48 +03:00
Joffrey JAFFEUX 2f0205e5c8
FIX: excludes .svg-as-img from JS sizing (#12906) 2021-04-30 11:00:16 +02:00
Andrei Prigorshnev d3b05f8a9c
FEATURE: always insert images on new lines and add newline after (#12895) 2021-04-30 12:38:28 +04:00
Penar Musaraj 54b7a0d06c
FIX: Keep filter UI after editing post (#12898) 2021-04-29 14:56:23 -04:00
Robin Ward 51f872f13a
DEV: Require Ember CLI to be used in development mode (#12738)
We really want to encourage all developers to use Ember CLI for local
development and testing. This will display an error page if they are not
with instructions on how to start the local server.

To disable it, you can set `NO_EMBER_CLI=1` as an ENV variable
2021-04-29 14:13:36 -04:00
Robin Ward bd23e793b7
DEV: Add top level `<div>` when using Ember CLI (#12878)
Eventually we'd like to remove this but it makes our Ember CLI build
consistent with the non-ember version.
2021-04-29 14:13:19 -04:00
Dan Ungureanu 614166ab1e
UX: Reduce the number of columns on invite page (#12891)
We used to have different columns for invite type, groups and topics,
which sometimes introduced a lot of whitespace or distorted the other
columns.
2021-04-29 16:44:51 +03:00
Jeff Wong 849b786378
DEV: refactor font sizing into css custom variables (#12746)
* DEV: refactor font sizing into css custom variables

Add font variables as css variables. Allows plugins/themes to update/overwrite the variables and have core pick up changes. This allows for a theme or plugin to overhaul core's font ratios if desired.
2021-04-28 17:21:59 -07:00
Osama Sayegh 4f88f2eb15
FEATURE: Allow theme tests to be run in production (take 2) (#12845)
This commit allows site admins to run theme tests in production via a new `/theme-qunit` route. When you visit `/theme-qunit`, you'll see a list of the themes/components installed on your site that have tests, and from there you can select a theme or component that you run its tests.

We also have a new rake task `themes:install_and_test` that can be used to install a list of themes/components on a temporary database and run the tests of the themes/components that are installed. This rake task can be useful when upgrading/deploying a Discourse instance to make sure that the installed themes/components are compatible with the new Discourse version being deployed, and if the tests fail you can abort the build/deploy process so you don't end up with a broken site.
2021-04-28 23:12:08 +03:00
Penar Musaraj e832088edf
UX: Fix styling for long label in multi-select choices (#12877) 2021-04-28 15:12:01 -04:00
Joffrey JAFFEUX 8be0191ffc
UI: minor tweaks to insert-hyplink modal (#12871)
- ensures footer buttons are aligned
- prevents focus on close button to be much larger than it should be, note that this fix could impact other modals but the current solution is not working, so better fix it differently if needed
2021-04-28 17:21:23 +02:00
Penar Musaraj 548c044809
FIX: Improvements to animated image pausing (#12839) 2021-04-28 10:48:00 -04:00
Joffrey JAFFEUX aa9a8d1041
UI: ensures toolbar gear button has identic color and height (#12872) 2021-04-28 16:22:30 +02:00
Joffrey JAFFEUX 71fd01c8ec
FIX: ensures successive topic hydrates doesn't override category (#12865)
This bug has first been seen when loading similar topics, minimum repro:

- Have a topic named "Something Foo Bar" with a category.

- Call this in console:
```
Discourse.currentUser.store.find("similar-topic", { title: "Something foo bar", raw: "" })
```

- Navigate to latest (no full refresh)

- The category from the topic should have disappeared
2021-04-28 16:12:11 +02:00
Martin Brennan 6d53005e8b
Revert "DEV: Improving topic tracking state code (#12555)" (#12864)
This reverts commit 45df579db0.

This was causing huge browser freezes and crashes.
2021-04-28 11:29:54 +10:00
Martin Brennan 45df579db0
DEV: Improving topic tracking state code (#12555)
The aim of this PR is to improve the topic tracking state JavaScript code and test coverage so further modifications can be made in plugins and in core. This is focused on making topic tracking state changes easier to respond to with callbacks, and changing it so all state modifications go through a single method instead of modifying `this.state` all over the place. I have also tried to improve documentation, make the code clearer and easier to follow, and make it clear what are public and private methods.

The changes I have made here should not break backwards compatibility, though there is no way to tell for sure if other plugin/theme authors are using tracking state methods that are essentially private methods. Any name changes made in the tracking-state.js code have been reflected in core.

----

We now have a `_trackedTopicLimit` in the tracking state. Previously, if a topic was neither new nor unread it was removed from the tracking state; now it is only removed if we are tracking more than `_trackedTopicLimit` topics (which is set to 4000). This is so plugins/themes adding topics with `TopicTrackingState.register_refine_method` can add topics to track that aren't necessarily new or unread, e.g. for totals counts.

Anywhere where we were doing `tracker.states["t" + data.topic_id] = newObject` has now been changed to flow through central `modifyState` and `modifyStateProp` methods. This is so state objects are not modified until they need to be (e.g. sometimes properties are set based on certain conditions) and also so we can run callback functions when the state is modified.

I added `onStateChange` and `onMessageIncrement` methods to register callbacks that are called when the state is changed and when the message count is incremented, respectively. This was done so we no longer need to do things like `@observes("trackingState.states")` in other Ember classes.

I split up giant functions like `sync` and `establishChannels` into smaller functions for readability and testability, and renamed many small functions to _functionName to designate them as private functions which not be called by consumers of `topicTrackingState`. Public functions are now all documented (well...at least ones that are not immediately obvious).

----

On the backend side, I have changed the MessageBus publish events for TopicTrackingState to send back tags and tag IDs for more channels, and done some extra code cleanup and refactoring. Plugins may override `TopicTrackingState.report` so I have made its footprint as small as possible and externalised the main parts of it into other methods.
2021-04-28 09:54:45 +10:00
Roman Rizzi cdbdb04909
UX: The Site's logo is the selected option when changing the system's user avatar. (#12861)
If the "use_site_small_logo_as_system_avatar" setting is enabled, the site's small logo is displayed as the selected option by the avatar-selector. Choosing a different avatar disables the setting.
2021-04-27 17:28:15 -03:00
Robin Ward 42251e2fe6
FIX: Recent regression meant we were proxying qunit when we shouldn't (#12860) 2021-04-27 14:40:17 -04:00
Kris b6aacc4c2d
UX: fix positioning of back button on progress bar (#12847) 2021-04-27 14:24:04 -04:00
Andrei Prigorshnev 2c4fd7f7c7
FIX: No JIT when quoting a mention (#12835) 2021-04-27 19:36:17 +04:00
Krzysztof Kotlarek e29605b79f
FEATURE: the ability to search users by custom fields (#12762)
When the admin creates a new custom field they can specify if that field should be searchable or not.

That setting is taken into consideration for quick search results.
2021-04-27 15:52:45 +10:00
Kris 22d23c4af1
UX: consistent topic timer message button order (#12826) 2021-04-26 18:56:01 -04:00
Kris b3cf483813
UX: Mobile consistency for topic status messages (#12828) 2021-04-26 18:55:50 -04:00
Kris c0bd7db799
UX: Improve alignment and spacing of category headers (#12829) 2021-04-26 18:55:18 -04:00
Kris ed373b2e7b
A11Y: Category logos are decorative, set empty alt (#12830) 2021-04-26 18:54:56 -04:00
Blake Erickson 0f3b5387ea
DEV: Add select-kit helper isDisabled (#12827)
In a qunit test for a plugin I need to be able to check if a select-kit
element is disabled or not. Adding this helper in core allows me to do that.
2021-04-26 14:39:41 -06:00
Osama Sayegh a169dc6832
Revert "FEATURE: Allow theme tests to be run in production (#12815)" (#12840)
This reverts commit 7217dcb67a.

https://meta.discourse.org/t/failed-to-bootstrap-due-to-out-of-memory-killer/188141/18?u=osama

Precompiling test_helper.js is so expensive that it can make bootstrap
fail on servers with limited resources (2GB RAM). We will find another
way that doesn't require much resources.
2021-04-26 23:05:58 +03:00
Dan Ungureanu b32c7df0e9
FEATURE: Share Topic modal improvements (#12834)
This PR includes few commits that improve the new "Share Topic" modal: same
icon for notify button as the notification, advanced options are only showed
for staff, but the topic name should be visible to everyone.
2021-04-26 19:08:59 +03:00
Bianca Nenciu 2c417338ed
FIX: Make diffHTML handle external changes (#12821)
Changing the contents of the preview element between two uses of
diff.innerHTML did not apply the diff correctly.
2021-04-26 14:28:08 +03:00
Osama Sayegh 7217dcb67a
FEATURE: Allow theme tests to be run in production (#12815)
This commit allows site admins to run theme tests in production via a new `/theme-qunit` route. When you visit `/theme-qunit`, you'll see a list of the themes/components installed on your site that have tests, and from there you can select a theme or component that you run its tests.

We also have a new rake task `themes:install_and_test` that can be used to install a list of themes/components on a temporary database and run the tests of the themes/components that are installed. This rake task can be useful when upgrading/deploying a Discourse instance to make sure that the installed themes/components are compatible with the new Discourse version being deployed, and if the tests fail you can abort the build/deploy process so you don't end up with a broken site.
2021-04-26 12:56:45 +03:00
Bianca Nenciu 7c3268e0c5
FIX: Show staff bulk actions only to staff (#12823)
The bulk button is normally shown only to staff, which is why we did not
do any explicit permissions check. Now we do display it on the messages
page too, where it is accessible to everyone.
2021-04-26 12:40:52 +03:00
Penar Musaraj 886f4b589e
FIX: Bug when scrolling in iOS Safari with composer open (#12831)
Regression was introduced in c54609.

This ensures the full height composer styling only applies when (window
height - viewport height > 0). Previously it was being wrongly triggered
when that calculation returned a negative number.
2021-04-25 22:14:13 -04:00
Roman Rizzi 60059a7190
FEATURE: A low priority filter for the review queue. (#12822)
This filter hides reviewables with a score lower than the "reviewable_low_priority_threshold" setting. We only use reviewables that already met this threshold to calculate the Medium and High priority filters.
2021-04-23 15:34:24 -03:00
Robin Ward 4ccbecf480
FIX: Forward all the HTTP headers through when we bootstrap Ember CLI (#12824) 2021-04-23 14:33:58 -04:00
Mark VanLandingham 1f863d2a30
UX: Improve copy when no results in bookmarks and notifications quick access panel (#12820) 2021-04-23 12:17:42 -05:00
Jeff Wong 04291c79dd
DEV: add group-post-additional-member-info plugin outlet (#12810) 2021-04-23 09:58:29 -07:00
Penar Musaraj dd3e16c1e4
DEV: Add group join/leave events (#12817) 2021-04-23 12:47:18 -04:00
Dan Ungureanu cfee2728ce
FEATURE: New share topic modal (#12804)
The old share modal used to host both share and invite functionality,
under two tabs. The new "Share Topic" modal can be used only for
sharing, but has a link to the invite modal.

Among the sharing methods, there is also "Notify" which points out
that existing users will simply be notified (this was not clear
before). Staff members can notify as many users as they want, but
regular users are restricted to one at a time, no more than
max_topic_invitations_per_day. The user will not receive another
notification if they have been notified of the same topic in past hour.

The "Create Invite" modal also suffered some changes: the two radio
boxes for selecting the type (invite or email) have been replaced by a
single checkbox (is email?) and then the two labels about emails have
been replaced by a single one, some fields were reordered and the
advanced options toggle was moved to the bottom right of the modal.
2021-04-23 19:18:23 +03:00
Robin Ward e3b1d1a718
DEV: Improve Ember CLI's bootstrap logic (#12792)
* DEV: Give a nicer error when `--proxy` argument is missing

* DEV: Improve Ember CLI's bootstrap logic

Instead of having Ember CLI know which URLs to proxy or not, have it try
the URL with a special header `HTTP_X_DISCOURSE_EMBER_CLI`. If present,
and Discourse thinks we should bootstrap the application, it will
instead stop rendering and return a HTTP HEAD with a response header
telling Ember CLI to bootstrap.

In other words, any time Rails would otherwise serve up the HTML for the
Ember app, it stops and says "no, you do it."

* DEV: Support asset filters by path using a new options object

Without this, Ember CLI's bootstrap would not get the assets it wants
because the path it was requesting was different than the browser path.
This adds an optional request header to fix it.

So far this is only used by the styleguide.
2021-04-23 10:24:42 -04:00
Joffrey JAFFEUX 6b10ada752
FIX: ensures successive tags can be renamed (#12818)
Original bug report: https://meta.discourse.org/t/rename-tag-not-working-as-expected/184950

This bug was caused by the use of `oneWay` which can be very dangerous in this case, from the documentation:

> computed.oneWay only provides an aliased get. The set will not mutate the upstream property, rather causes the current property to become the value set. **This causes the downstream property to permanently diverge from the upstream property.**
2021-04-23 16:18:23 +02:00
Bianca Nenciu ce4017ab33
FEATURE: Show a notice if video cannot be rendered (#12718)
Not all videos can be rendered everywhere because some browser may be
missing some codecs. This commit adds a notice on top of video to let
the user know about it.
2021-04-23 16:56:13 +03:00
Arpit Jalan e53b474557
FIX: allow moderators to access /admin/customize/watched_words (#12816)
Moderators were unable to access `/admin/customize/watched_words`
feature. This was regressed in 61860098d9
2021-04-23 18:51:45 +05:30
Kris abbb3a6be5
DEV: add tag-navigation plugin outlet (#12814)
Adds a plugin outlet to the tag template to match the `category-navigation` outlet on category pages (using this for a customer theme component).
2021-04-23 10:38:07 +02:00
Jeff Wong 4b8d23c0d4
DEV: Add primary group class to user summary page (#12809) 2021-04-22 16:11:15 -07:00
Jeff Wong e01d5f80b4
Add primary group classes (#12807)
* DEV: expose primary group as classes in more areas.

Add group classes in the group posts pages

Add primary group name as a class on the user card
2021-04-22 15:00:23 -07:00
David Taylor 890b06b10f
FIX: Ensure tag topic lists are not scrolled to an incorrect position (#12805)
When navigating from a 'discovery' topic list to a 'tags' topic list, the scroll position from the 'discovery' list was being used by the tag list. That meant the user would be taken to a random point in the list, and not scrolled to the top.

Non-tag topic lists were working fine because we only apply the 'cached' logic (and by extension, the saved scroll location) when the user clicks 'back' in the browser. In the code, this is referred to as `isPoppedState`.

This commit takes the `isPoppedState` logic from the regular topic lists, and applies it to the tag topic lists.
2021-04-22 16:09:20 -05:00
Kris 984d87f30c
UX: stop presence indicator hop, space consistency (#12797) 2021-04-22 16:11:47 -04:00
Bianca Nenciu 6c5d6dd356
Improve validation for polls and improve builder (#12745)
* FIX: Show date picker over modal

Previously, scrolling was necessary to see the whole picker.

* FEATURE: Improve validation for polls

Adds new error messages for each of the edge cases. Previously, it
failed with a simple error saying that the minimum value must be less
than the maximum value.

* UX: Copy edit
2021-04-22 21:36:32 +03:00
Penar Musaraj 139ba69117
FIX: Do not add CSS transition effect to animated images (#12803)
Followup to c11d75da87, the transition
delays the pause/play action.
2021-04-22 14:05:48 -04:00
Penar Musaraj c11d75da87
FEATURE: Allow pausing animated images in posts (#12795)
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-04-22 11:28:35 -04:00
Arpit Jalan 1e9301d4d8
UX: do not pre-select blank tag on append tags bulk action (#12801)
UX: show progress screen only when more than 20 topics are selected
2021-04-22 20:32:15 +05:30
Penar Musaraj fd6f0db788
DEV: Fix flaky Ember test (#12802) 2021-04-22 10:25:20 -04:00
Ahmed Gagan 3867b8998c
DEV: allows reports to display an html title (#12687)
eg: display an emoji in title
2021-04-22 13:38:10 +02:00
Joffrey JAFFEUX e2e936715e
UX: uses native date picker when possible (eg: not safari) (#12668)
Note that this is only applied on date-input and not the old date-picker for now.

This commit is also slightly modifying admin report dates form to ensure the native picker is correctly used, as a result: it doesn’t auto refresh on date change and fixes a border bug.
2021-04-22 10:34:23 +02:00
Joffrey JAFFEUX 0eeedf307a
DEV: replaces huge generated emoji list by a simpler regex (#11053)
Note that this commit is also fixing various mistakes in emojis.

Some of them have been fixed manually in db.json/data.js/groups.json and will need to be fixed in emoji-db gem.
2021-04-22 08:43:06 +02:00
Kris e0d17c8d19
UX: Prevent topic progress bar from overlapping (#12780) 2021-04-21 22:53:23 -04:00
Penar Musaraj 95223938a5
FIX: Exclude emoji images from JS sizing (#12796)
Should remove jumpiness when using the experimental
`disable_image_size_calculations` site setting.
2021-04-21 20:51:44 -04:00
Martin Brennan 206d8db433
FIX: Invalid Date on "last" shortcut for timer + bookmarks (#12783)
The "last custom date and time" shortcut for the topic timer and
bookmarks could get into a state where it had an Invalid Date if
the user opened the topic timer modal, clicked Custom Date and then
closed the modal without making changes. This has been fixed, the
last custom date + time will no longer be set in this case and if
somehow the last custom date + time is invalid that option will not
show.

Also improve the wording from just "Last" to "Last custom datetime"
2021-04-22 09:26:31 +10:00
Jarek Radosz 2dfa1a267e
FIX: `TagDrop` uses `currentCategory` now (#12786) 2021-04-21 21:46:52 +02:00
Kris b9b4d2485b
UX: fix layout of group header buttons on mobile (#12781) 2021-04-21 15:45:45 -04:00
Jarek Radosz ad406b6e11
FEATURE: Make `category-navigation` outlet tagless (#12788) 2021-04-21 15:45:09 -04:00
Neil Lalonde f186ff99c8
FIX: blank avatar on user card if flair url is undefined (#12791)
If creating a group avatar flair with no icon or image, the user card
was showing a blank circle.
2021-04-21 15:43:50 -04:00
Jeff Wong 27771ad189
Group posts adhere to prioritize name in UX option (#12789)
Displays either username or name on the group activity page.
Removes hardcoded comma, and adds classes to share padding styling
2021-04-21 10:30:25 -07:00
Penar Musaraj 24715115f5
DEV: Experiment with relative image sizes and native image lazy loading (#12759) 2021-04-21 12:41:45 -04:00
Roman Rizzi 6b613e3076
FEATURE: Review every post using the review queue. (#12734)
* FEATURE: Review every post using the review queue.

If the `review_every_post` setting is enabled, posts created and edited by regular uses are sent to the review queue so staff can review them. We'll skip PMs and posts created or edited by TL4 or staff users.

Staff can choose  to:

- Approve the post (nothing happens)
- Approve and restore the post (if deleted)
- Approve and unhide the post (if hidden)
- Reject and delete it
- Reject and keep deleted (if deleted)
- Reject and suspend the user
- Reject and silence the user

* Update config/locales/server.en.yml

Co-authored-by: Robin Ward <robin.ward@gmail.com>

Co-authored-by: Robin Ward <robin.ward@gmail.com>
2021-04-21 08:41:36 -03:00
Kris 62e882ad11
UX: Fix focus style for post edit history button (#12757) 2021-04-20 21:03:47 -04:00
Kris 3c0164f369
UX: Update positioning of mobile post controls (#12760) 2021-04-21 09:43:26 +10:00
Jordan Vidrine d51a226da4
FIX: Revert color of post-map (#12774)
* FIX: Revert color of post-map

This commit changes post-map colors back to original after a11y changes.
2021-04-20 17:38:13 -05:00
Kris 5e97946f9f
UX: improve user card control layout for long text (#12770) 2021-04-20 18:34:33 -04:00
Jordan Vidrine f33b7c8f65
UX: Wider drop down for top page select kit (#12766) 2021-04-20 15:53:30 -05:00
Robin Ward 8f244cd1b9
FIX: If we want a `.json` path, don't bootstrap (#12772) 2021-04-20 14:26:15 -04:00
Kris c7653d2e78
UX: Update signup cta styles (#12761) 2021-04-20 13:00:39 -04:00
Arpit Jalan e54b5dadab
UX: show error message instead of disabling save button on tag groups page (#12767)
https://meta.discourse.org/t/unable-to-rename-tag-groups-title-save-button-stays-grayed-out/172293/
2021-04-20 21:40:02 +05:30
Martin Brennan cc7e352f30
FIX: Clientside validate min tags for required tag group (#12758)
When the user has not selected any tags and minimum_required_tags
is specified for a category, they get a clientside validation error
to tell them this. We were not doing the same thing when
min_tags_from_required_group and required_tag_groups was specified.
2021-04-20 10:39:13 +10:00
Jordan Vidrine 19cb05661d
FEATURE: Topic count in category boxes (#12756)
* FEARTURE: Also add outlet to featured topic category boxes
2021-04-19 16:24:17 -05:00
Jordan Vidrine f74d9ca399
FEATURE: Add plugin outlet for category-box-below-each-category (#12755) 2021-04-19 13:19:06 -05:00
Kris 28d5a3f21f
UX: smoother timeline footer animation, padding fix (#12743) 2021-04-19 13:00:12 -04:00
webdirektindia 42f8f6b4a2
Adding after-groups-index-container plugin-outlet (#12750) 2021-04-19 16:17:39 +02:00
Penar Musaraj ff601504f7
DEV: Fix linting (#12754) 2021-04-19 09:28:07 -04:00
Penar Musaraj f0000f5017
UX: Mobile styling for discard draft modal buttons (#12735)
Co-authored-by: Kris  <kris.aubuchon@discourse.org>
2021-04-19 09:23:41 -04:00
Joffrey JAFFEUX 191fac5c7c
DEV: makes transformComplete async (#12752)
This is used to apply multiple transformations following user input.
2021-04-19 11:40:23 +02:00
Joffrey JAFFEUX 99aae959a6
DEV: adds an experimental `preserveKey` bool option to autocomplete (#12751)
Usage:

```
$(input).autocomplete({
  preserveKey: false
});
```

Defaults to true.
2021-04-19 11:40:05 +02:00
Martin Brennan e3b1f5721b
FIX: Enforce tag group count validation before sending to review queue (#12728)
There is a category setting that enforces 1 or more tags must be added to a topic from a specific tag group before creating it. This validation was not being run before the topic was being sent to a review queue for categories that have that setting enabled.

There was an existing validation in `TopicCreator` but it was not correct; it was only validating when the tags did _not_ exist and also only happened on `create`. I now run the validation in `TopicCreator.valid?`

I also improved the error message shown to the user when they have not added the tags required (showing the tag names from the tag group), and changed the composer tag selector to not show "optional" if there are N tags required from a certain group.
2021-04-19 09:43:50 +10:00
Andrei Prigorshnev 8c6ea967ae
FEATURE: Show the slow mode indicator in composer (#12720) 2021-04-17 23:40:09 +04:00
Jeff Wong 75abe8d295
DEV: make font sizing and ratios default (#12741)
Make it easier for themes/plugins to use Discourse's built in font sizing
and override font ratios
2021-04-16 12:58:16 -07:00
Penar Musaraj 9581d71372
FIX: Allow CodeCommit-style theme .git url format (#12739) 2021-04-16 12:46:34 -04:00
Gerhard Schlager c60ccfed98
DEV: Add app event "topic:timings-sent" (#12737) 2021-04-16 18:34:49 +02:00
Gerhard Schlager 74e84a1953
DEV: Export regex for parsing topic URL (#12740) 2021-04-16 18:34:39 +02:00
Penar Musaraj 35f977f8a5
UX: Prevent some composer buttons from receiving focus (#12719) 2021-04-16 11:10:02 -04:00
Régis Hanol 2aed82e646
FIX: whitespaces when copying code blocks (#12730)
This ensures the copied text always has proper white space characters.
2021-04-16 10:28:47 +02:00
Bianca Nenciu 96a16123d8
FIX: Generate unique HTML heading names (#12705)
Headings with the exact same name generated exactly the same heading
names, which was invalid. This replaces the old code for generating
names for non-English headings which were using URI encode and resulted
in unreadable headings.
2021-04-16 10:54:19 +03:00
Robin Ward 42f6c9b6b9
FIX: Docking mixin was not cleaning up timers (#12638)
I noticed this while trying to debug slow performing ember tests.
Our docking mixin sometimes sets timers but never cancels them when
removed. I'm not sure of any errors this causes but we should be tidying
up whenever the component is removed.
2021-04-16 11:33:19 +10:00
Kris d89e9fcfa3
FIX: remove old usercard styles, fix bg img class (#12712) 2021-04-15 16:34:47 -04:00
Andrei Prigorshnev eb99ecf1d2
FEATURE: In the slow mode dialog make "Enabled Until" mandatory (#12701) 2021-04-15 19:16:01 +04:00
Penar Musaraj c54609bfcd
UX: Full height composer on mobile Android (#12709) 2021-04-15 09:02:24 -04:00
Dan Ungureanu 4d87360f84
UX: Minor styling improvements to invites (#12715)
Reduce the width of the modal to make it consistent with other modals
and use the full width for inputs with a button on the right side.
2021-04-15 14:46:49 +03:00
Andrei Prigorshnev 3326d1ff73
FEATURE: Tweak slow mode messages and intervals (#12704) 2021-04-15 13:56:10 +04:00
Joffrey JAFFEUX 81498bd131
DEV: updates to onebox 2.2.14 (#12713)
This commit also updates github’s body onebox styles in Discourse core:
- full width
- prevents show-more btn to trigger vertical scrolling
- makes text standout less and slightly bigger
2021-04-15 10:58:39 +02:00
Joffrey JAFFEUX ae27717b61
UX: moves from summary/details to a button to expand github body (#12698) 2021-04-15 08:52:04 +02:00
Rafael dos Santos Silva b5fba751a0
DEV: Do not install service workers in development (#12708) 2021-04-14 18:21:28 -03:00
Robin Ward 32689573fa
FIX: Already sent headers error in Ember CLI (#12706)
If we are sending a custom template, we shouldn't do a `next()`,
we should halt middleware.
2021-04-14 15:25:49 -04:00
Robin Ward e459937ffa
FIX: `this.loading` is undefined, it should be `state.loading` (#12707)
This might prevent issues with double requests on the user notifications panel.
2021-04-14 15:21:54 -04:00
Régis Hanol c1fc2a1e9b
FIX: handle permalinks with query parameters (#12700) 2021-04-14 20:03:25 +02:00
Robin Ward 6a7a8f32f1
FIX: `ember build` was not adding digests to additional bundles (#12703)
* FIX: `ember build` was not adding digests to additional bundles

* Update app/assets/javascripts/discourse/ember-cli-build.js

Co-authored-by: Jarek Radosz <jradosz@gmail.com>

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-04-14 13:37:22 -04:00
Robin Ward 0afcf9e12e
DEV: Support Node 15 with Ember CLI (#12679)
* DEV: Support Node 15 with Ember CLI

* FIX: Broken tests that needed to be updated in newer Ember CLI
2021-04-14 10:16:39 -04:00
Dan Ungureanu 528cfea079
FEATURE: Auto-activate users invited by email (#12675)
When invited by email, users will receive an invite URL which contains
a token. If that token is present when the invite is redeemed, their
account will be automatically activated.
2021-04-14 12:15:56 +03:00
Bianca Nenciu e4e2c7c66f
FIX: Improve anchor links (#12683)
* FIX: Use theme color for anchor icon

* FIX: Do not count anchor links

* FIX: Do not count hashtags links either

* DEV: Add tests for link_count

* FIX: Disable anchors in quotes and preview

* FIX: Try building some anchor slugs for unicode

* DEV: Fix tests
2021-04-14 10:27:07 +03:00
Martin Brennan eeaecd4fd2
FEATURE: Category setting to allow unlimited first post edits by the owner of the topic (#12690)
This PR adds a new category setting which is a column in the `categories` table, `allow_unlimited_owner_edits_on_first_post`.

What this does is:

* Inside the `can_edit_post?` method of `PostGuardian`, if the current user editing a post is the owner of the post, it is the first post, and the topic's category has `allow_unlimited_owner_edits_on_first_post`, then we bypass the check for `LimitedEdit#edit_time_limit_expired?` on that post.
* Also, similar to wiki topics, in `PostActionNotifier#after_create_post_revision` we send a notification to all users watching a topic when the OP is edited in a topic with the category setting `allow_unlimited_owner_edits_on_first_post` enabled.

This is useful for forums where there is a Marketplace or similar category, where topics are created and then updated indefinitely by the OP rather than the OP making new topics or additional replies. In a way this acts similar to a wiki that only one person can edit.
2021-04-14 15:54:09 +10:00
Martin Brennan c07a6eeb6d
FIX: Software update prompt fixes and improvements (#12648)
* Fixes the z-index of the prompt so it is behind the quick access panels
* Adds a dismiss `X` button (made sure the click target of this was quite big)
* Change structure of HTML to address template lint issues
* Fix aria-hidden not returning true/false
* Reload current page instead of navigating to / when clicking on the prompt message
2021-04-14 10:26:23 +10:00
David Taylor da6edc117c
FIX: Allow raw-view classes to be resolved from themes/plugins (#12685)
Since cd24eff5d9, theme modules are now prefixed with the theme id. Therefore themes which defined raw-view classes will be broken

This commit updates the `raw` helper to use the resolver for looking up the view class. This automatically takes care of trying theme/plugin paths in addition to core paths.
2021-04-13 15:05:46 +01:00
Faizaan Gagan c45dbe4159
enable eol-last for eslint and ember-template-lint (#12678)
enable eol-last for eslint and ember-template-lint

Fixed a handlful of .hbs files where newlines weren't present
2021-04-12 17:22:00 -07:00
Robin Ward abe588c2c8
Update `caniuse-lite` to the latest version (#12677) 2021-04-12 14:06:17 -04:00
Jarek Radosz 7d1cef71ff
DEV: Remove ScrollTop mixin (#12673)
It was deprecated (incorrectly! see the import 😅) 5 years ago. No references found anymore in core and all-the-plugins.
2021-04-12 17:52:53 +02:00