Commit Graph

16916 Commits

Author SHA1 Message Date
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
Osama Sayegh cd24eff5d9
FEATURE: Introduce theme/component QUnit tests (take 2) (#12661)
This commit allows themes and theme components to have QUnit tests. To add tests to your theme/component, create a top-level directory in your theme and name it `test`, and Discourse will save all the files in that directory (and its sub-directories) as "tests files" in the database. While tests files/directories are not required to be organized in a specific way, we recommend that you follow Discourse core's tests [structure](https://github.com/discourse/discourse/tree/master/app/assets/javascripts/discourse/tests).

Writing theme tests should be identical to writing plugins or core tests; all the `import` statements and APIs that you see in core (or plugins) to define/setup tests should just work in themes.

You do need a working Discourse install to run theme tests, and you have 2 ways to run theme tests:

* In the browser at the `/qunit` route. `/qunit` will run tests of all active themes/components as well as core and plugins. The `/qunit` now accepts a `theme_name` or `theme_url` params that you can use to run tests of a specific theme/component like so: `/qunit?theme_name=<your_theme_name>`.

* In the command line using the `themes:qunit` rake task. This take is meant to run tests of a single theme/component so you need to provide it with a theme name or URL like so: `bundle exec rake themes:qunit[name=<theme_name>]` or `bundle exec rake themes:qunit[url=<theme_url>]`.

There are some refactors to how Discourse processes JavaScript that comes with themes/components, and these refactors may break your JS customizations; see https://meta.discourse.org/t/upcoming-core-changes-that-may-break-some-themes-components-april-12/186252?u=osama for details on how you can check if your themes/components are affected and what you need to do to fix them.

This commit also improves theme error handling in Discourse. We will now be able to catch errors that occur when theme initializers are run and prevent them from breaking the site and other themes/components.
2021-04-12 15:02:58 +03:00
Joffrey JAFFEUX 18777d9108
DEV: implements some of ember-truth-helpers (#12667)
The implemented helpers, are helper which might be in Ember core in the future:

- and
- or
- not
- eq
- not-eq
- lt
- lte
- gt
- gte

They follow the implementation of ember-truth-helpers: https://github.com/jmurphyau/ember-truth-helpers

Note 1: Ember rfcs are still debating going with {{not-eq}} or {{neq}}, should be easy to support in the future whatever is finally chosen.

Note 2: this commit also moves it to its own addon, and removes the {{not}} test, to simplify further updates.
2021-04-12 11:40:00 +02:00
Joffrey JAFFEUX 2dc8bfd1ba
UI: adds styling for new github PR body details/summary (#12669)
https://github.com/discourse/onebox/pull/466
2021-04-12 10:45:16 +02:00
Penar Musaraj abb0a4bae2
DEV: Add SCSS helper to replace `asset-uri` and `image-uri` (#12664) 2021-04-12 13:57:39 +10:00
Joffrey JAFFEUX b6337b72f1
FEATURE: adds last day to about page stats (#12663)
* FEATURE: adds last day to about page stats

* make it clear it's last 24 hours

* applies same copy fix to days
2021-04-12 12:50:33 +10:00
Roman Rizzi 8339b8f412
FEATURE: Make the tag_groups#search endpoint public. (#12643)
The method uses the "TagGroup#visible" method to respect the tag group visibility settings.
2021-04-08 14:23:13 -03:00
Penar Musaraj eb7ff576e5
FEATURE: Use SVG icons for some oneboxes (#12654) 2021-04-08 09:58:12 -04:00
Joffrey JAFFEUX 081ada090c
UX: shows a hint when there are more tags than displayed (#12649) 2021-04-08 15:51:31 +02:00
Robin Ward 7e2b7bdd78
DEV: Adds new plugin API support to always show the topic map (#12642)
You can enable this by using the `includePostAttributes` API call with
the value of `topicMap`. This will always show the topic map at the top
of a topic regardless of how many posts there are.
2021-04-08 08:19:25 -04:00
Joffrey JAFFEUX 6081f8e5e9
UX: always display remove emoji btn from emoji-value-list (#12652)
Although if emoji is not editable it should be disabled.
2021-04-08 13:34:26 +02:00
Joffrey JAFFEUX e463f5ce08
DEV: introduces {{not}} helper (#12651)
Code is coming from https://github.com/jmurphyau/ember-truth-helpers, for now I only ported {{not}} which would have tons of use cases in our code base.

We might want to use more helpers in the future, also Ember should have this kind of helpers natively in the future:

- https://github.com/cibernox/rfcs/blob/add-logical-operators-to-templates/text/0000-add-logical-operators.md
- https://github.com/cibernox/rfcs/blob/add-equality-operators-to-templates/text/0000-add-equality-operators.md
- https://github.com/cibernox/rfcs/blob/add-numeric-comparison-operators-to-templates/text/0561-add-numeric-comparison-operators.md
2021-04-08 13:25:16 +02:00
Krzysztof Kotlarek 8b735e6f9e
FIX: dismiss new button for tags on top (#12628)
Currently, new topics for specific tags can be dismissed with the button at the bottom of the page.

When there is more than 15 new topics, we should display the same button at the top as well. It already works in the same manner for categories.
2021-04-08 10:46:08 +10:00
Kris d12707c18e
FIX: mobile topic list number alignment (#12641) 2021-04-07 18:14:12 -04:00
Kris ea2105f3e8
REFACTOR: Consistency, A11Y, and less text for composer toggles (#12627) 2021-04-07 16:15:07 -04:00
David Taylor 9c78bb26d7
FIX: Ensure software-update banner is only shown after 24 hours (#12634)
`isTesting` is a function, so `if(isTesting)` was only checking for the presence of the function. We need to actually evaluate it. Followup to 68a032a734
2021-04-07 17:00:23 +01:00
Roman Rizzi 5e4c0e2caa
FEATURE: Treat site settings as plain text and add a new HTML type. (#12618)
To add an extra layer of security, we sanitize settings before shipping them to the client. We don't sanitize those that have the "html" type.

The CookedPostProcessor already uses Loofah for sanitization, so I chose to also use it for this. I added it to our gemfile since we installed it as a transitive dependency.
2021-04-07 12:51:19 -03:00
Osama Sayegh 2b9ab3a0d9
Revert "FEATURE: Introduce theme/component QUnit tests (#12517)" (#12632)
This reverts commit a53d8d3e61 and 105634435f.

Reverted because the change broke some components. Will be added back in a few days.
2021-04-07 17:45:49 +03:00
Joffrey JAFFEUX 68a032a734
DEV: prevents test timeout (#12631)
Clock manipulation seems not reliable in component tests. This blog post does a great job of explaining it: https://dockyard.com/blog/2018/04/18/bending-time-in-ember-tests

Sadly, we don't have all the "recent" ember test helpers and can't use things like `getSettledState()`.

For now this pattern seems the most reliable and easy to apply, albeit not great.

Note if you wish to reproduce the current timeout, the following command should do it: `QUNIT_SEED=215263717493121190480103670124734840282 rake qunit:test`
2021-04-07 15:50:06 +02:00
Ahmed Gagan 2308a58113
DEV: Added support for custom site setting 'emoji_list' (#12414)
Example usage:

```
best_emojis:
    type: emoji_list
    default: laughing|open_mouth|cry|angry|hugs
    client: true
```
2021-04-07 15:32:05 +02:00
Osama Sayegh a53d8d3e61
FEATURE: Introduce theme/component QUnit tests (#12517)
This commit allows themes and theme components to have QUnit tests. To add tests to your theme/component, create a top-level directory in your theme and name it `test`, and Discourse will save all the files in that directory (and its sub-directories) as "tests files" in the database. While tests files/directories are not required to be organized in a specific way, we recommend that you follow Discourse core's tests [structure](https://github.com/discourse/discourse/tree/master/app/assets/javascripts/discourse/tests).

Writing theme tests should be identical to writing plugins or core tests; all the `import` statements and APIs that you see in core (or plugins) to define/setup tests should just work in themes.

You do need a working Discourse install to run theme tests, and you have 2 ways to run theme tests:

* In the browser at the `/qunit` route. `/qunit` will run tests of all active themes/components as well as core and plugins. The `/qunit` now accepts a `theme_name` or `theme_url` params that you can use to run tests of a specific theme/component like so: `/qunit?theme_name=<your_theme_name>`.

* In the command line using the `themes:qunit` rake task. This take is meant to run tests of a single theme/component so you need to provide it with a theme name or URL like so: `bundle exec rake themes:qunit[name=<theme_name>]` or `bundle exec rake themes:qunit[url=<theme_url>]`.

There are some refactors to internal code that's responsible for processing themes/components in Discourse, most notably:

* `<script type="text/discourse-plugin">` tags are automatically converted to modules.

* The `theme-settings` service is removed in favor of a simple `lib` file responsible for managing theme settings. This was done to allow us to register/lookup theme settings very early in our Ember app lifecycle and because there was no reason for it to be an Ember service.

These refactors should 100% backward compatible and invisible to theme developers.
2021-04-07 10:39:57 +03:00
Kris cdd5b60447
UX: icon instead of text for hiding mobile preview (#12625) 2021-04-06 22:22:40 -04:00
Arpit Jalan 21664d8a1c
DEV: add JS test for topic bulk action modal (#12621) 2021-04-07 06:34:36 +05:30
Tobias Eigen 2e17e6269c
FIX: Small tweaks to "no messages" education (#12588)
* Remove "Message" button in quick access menu no messages education
* Reword education prompt
* Remove background colour
2021-04-07 09:28:10 +10:00
Martin Brennan 432b839997
FEATURE: Move site updated modal into a less obtrusive prompt (#12577)
This moves the "This site was just updated" modal asking the user if they want to refresh into a subtle prompt that slides down from the header.

Also in this PR I've added a helper to publish message bus messages in JS tests. So instead of this:

```javascript
// Mimic a messagebus message
MessageBus.callbacks
  .filterBy("channel", "/global/asset-version")
  .map((c) => c.func("somenewversion"));
```

We can have:

```javascript
publishToMessageBus("/global/asset-version", "somenewversion");
```
2021-04-07 08:56:48 +10:00
Penar Musaraj 34596beb52
FIX: Keep current filter while navigating posts in a topic (#12620) 2021-04-06 15:00:25 -04:00
Robin Ward 75a0d9aa01
DEV: Add a new plugin outlet to composer bottom for mobile buttons (#12622) 2021-04-06 14:27:34 -04:00
Penar Musaraj cdb99f012b
FIX: Retain tags when loading a topic draft in composer (#12616) 2021-04-06 11:49:06 -04:00
Penar Musaraj 769b3ba8ae
DEV: Add colors/styling to Ember CLI and qunit tests (#12617) 2021-04-06 11:48:44 -04:00
Neil Lalonde e8a9917db1
FEATURE: Allow setting avatar flair for automatic groups (#12586) 2021-04-06 11:13:06 -04:00
Kris 1ebb40a713
FIX: show sign up modal when local logins are disabled (#12611) 2021-04-06 10:31:51 -04:00
Penar Musaraj 98ae4e2829
FIX: Clear state after creating new topic (#12615) 2021-04-06 10:17:14 -04:00
Penar Musaraj f56a22bd2e
FIX: New Topic button regression in tag page (#12613) 2021-04-06 09:31:49 -04:00
Joffrey JAFFEUX f14e898f6f
A11Y: makes replies count a button and not a link (#12570) 2021-04-06 08:27:43 +02:00
Kris 80be6e6949
Overflow on user controls breaks select-kit (#12592) 2021-04-05 23:42:44 -04:00
Kris 6f79c452c2
FIX: bulk select on full-page search (#12593) 2021-04-05 23:11:57 -04:00
Kris f8e5df393d
UX: better position for search bulk select button (#12594) 2021-04-05 23:11:43 -04:00
Joffrey JAFFEUX 89f1bb7d2a
FIX: with vanilla js .href and getAttribute("href") are not equal (#12609)
With a link having an empty href: `<a href>foo</a>` doing
`element.href` will give you the URL of the document, to get the same behavior than `$(element).attr("href")` and get "" you need to do `element.getAttribute("href")`
2021-04-06 00:36:28 +02:00
Kris 3a18dd5681
Revert "A11Y: Do not use positive tabindex in composer (#12563)" (#12603)
This reverts commit af879b7851.
2021-04-05 14:36:43 -04:00
Joffrey JAFFEUX 8a36b91c2c
DEV: removes jquery usage from intercept-click (#12600) 2021-04-05 11:59:58 +02:00
Arpit Jalan b230c30249
FIX: downloading watched words was broken (#12578) 2021-04-02 23:04:35 +05:30
Dan Ungureanu bfd0c00944
FEATURE: Copying invite link triggers a save (#12581)
Changing the invite type from link to email and then copying it was
confusing because it gave user the impression that the invite was
updated and the invite link will reflect the latest changes, but it
did not.
2021-04-02 11:19:30 +03:00
Kris 42fb806f43
A11Y: make th keyboard accessible + aria attribs (#11895) 2021-04-01 14:19:59 -04:00
Mark VanLandingham 1d2ddbfebf
DEV: Pass editFirstPost action to plugin outlet in topic.hbs (#12582) 2021-04-01 12:20:10 -05:00
Kane York 5d2cd15548
FEATURE: Use appEvents instead of jQuery for composer resizing progress (#12574)
Additionally, add a composer:resize-started event to complement composer:resize-ended.
2021-04-01 13:00:57 -04:00
Arpit Jalan 61860098d9
UX: move logs/watched_words to customize/watched_words in admin section (#12571)
https://meta.discourse.org/t/where-is-auto-tag-and-auto-replace/184261
2021-04-01 11:44:17 +05:30
Arpit Jalan c478ffc662
FIX: post merging was failing silently (#12566)
https://meta.discourse.org/t/merging-very-long-posts-removes-them/183597
2021-04-01 06:46:18 +05:30
Martin Brennan 28d67b4583
FEATURE: Show an educational message in the quick access menu for personal messages when there are none (#12564)
If the user has not been sent any messages, show a message in the quick access menu with an educational message. If the user can send private messages, also show a link to open the "new message" composer:

This also adds a general improvement to the quick-access-panel, to be able to show an `emptyStateWidget` instead of just a message if there is nothing to show in the panel, as well as initial general styles for empty state.
2021-04-01 10:22:40 +10:00
Krzysztof Kotlarek b317962fe2
FIX: title when YouTube is pasted as the title to composer (#12565)
When the YouTube link is passed to the composer, it should extract the title.

https://meta.discourse.org/t/youtube-link-not-generate-title/183776
2021-04-01 10:16:14 +11:00
Kris af879b7851
A11Y: Do not use positive tabindex in composer (#12563) 2021-03-31 17:33:14 -04:00
Bianca Nenciu 27b297472a
FIX: Reload messages after a bulk operation (#12569)
It did not show the updated state of the topic until user refreshed the
page.
2021-03-31 16:08:12 +03:00
Kris 44587cc4b4
UX: more consistent user control button width (#12553) 2021-03-30 14:18:38 -04:00
Kris 9c8ec372f1
UX: remove reference to contact form in settings (#12554) 2021-03-30 14:18:06 -04:00
Kris 6d65320aae
UX: login modal adjustments (#12552) 2021-03-30 14:16:50 -04:00
Penar Musaraj 524890c5e4
DEV: Clear filters when navigating to a post (#12557) 2021-03-30 13:55:15 -04:00
Bianca Nenciu 52a5c7e438
FIX: Improve error messages if user cannot send PM emails (#12547) 2021-03-30 12:18:57 +03:00
Penar Musaraj 2579127091
UX: Fix tab list alignment in emoji popup (#12548) 2021-03-29 16:30:20 -04:00
Faizaan Gagan ff814dcfc1
FIX: additionalOpts update and change to function (#12546)
* FIX: additionalOpts should be added outside conditional

* FIX: changed the computed property to function
2021-03-29 15:27:55 -04:00
Daniel Waterworth 70970bb791
FIX: Show error messages when adding permalinks in the admin UI (#12545)
Also, check for uniqueness of permalinks before attempting to save.
2021-03-29 13:36:59 -05:00
Roman Rizzi 1a3c5f55d6
FIX: Set the "hasTargetGroups" attribute in the composer when clicking the group message button. (#12536)
After clicking the message button on the group page, the composer shouldn't display the "official warning" checkbox. The discourse-bcc plugin also relies on this attribute to display an option in the composer.
2021-03-29 14:43:00 -03:00
Jarek Radosz f0b2e77abb
FIX: Isolate modal and global key-binds (#12477)
This change makes is so that when a time-picking modal (e.g.  "Add bookmark" modal) is visible, **all** global key bindings are paused.

1. Fixes an issue where opening and closing a time-picking modal would break global single-key keybinds, so for example, <kbd>L</kbd> would no longer like posts, but <kbd>L</kbd> <kbd>L</kbd> would
2. Fixes a related issue, where doing the above would also override custom keybinds provided by plugins (e.g. <kbd>L</kbd> shortcut that discourse-reactions uses)

Included:

* DEV: Reset Mousetraps instead of unbinding
* FIX: Make unbind use unbind
* DEV: Don't check for keyTrapper twice
* DEV: Use an instance of Mousetrap
* DEV: Remove an invalid `for` attribute (`set_reminder` doesn't exist)
* DEV: Add ability to pause all KeyboardShortcuts
* FIX: Pause all keybinds when in a time-picking modal
* DEV: Move bookmark keybind resets to willDestroyElement
* DEV: Fix shortcuts-related tests
2021-03-29 13:58:03 +02:00
Dan Ungureanu 8335c8dc1a
FEATURE: Allow admins to pre-populate user fields (#12361)
Admins can use bulk invites to pre-populate user fields. The imported
CSV file must have a header with "email" column (first position) and
names of the user fields (exact match).

Under the hood, the bulk invite will create staged users and populate
the user fields of those.
2021-03-29 14:03:19 +03:00
Dan Ungureanu 3c53d4d2d8
DEV: Add tests for create-invite modal (#12535) 2021-03-29 11:52:21 +03:00
Penar Musaraj db7be947df
FIX: Allow dismissing Discard Drafts modal via ESC (#12532) 2021-03-26 13:07:19 -04:00
Penar Musaraj edc0f61920
UX: Emoji popup layout adjustments (#12533) 2021-03-26 13:07:04 -04:00
Penar Musaraj 5096920500
FEATURE: Implement nonces for Google Tag Manager integration (#12531) 2021-03-26 11:19:31 -04:00
Faizaan Gagan 3bd482c6bd
IMPR: improved topic timer component's code structure (#12519)
This PR improves the code structure of the topic-timer-info component while retaining all the functionality and making it extensible for theme/plugin devs.
2021-03-26 09:12:16 +10:00
Dan Ungureanu dffc3a2f8e
DEV: Add tests for invite system (#12524) 2021-03-25 18:26:22 +02:00
Roman Rizzi 4505951d32
UX: Display a tooltip when trying to delete an automatic group. (#12493) 2021-03-25 11:07:38 -03:00
Jarek Radosz 50c23304ac
DEV: Move incorrectly placed topic tests (#12513)
The diff is confusing but the gist is that there are some topic acceptance tests that were incorrectly placed in "Topic featured links" group. This moves them into "Topic".

Moved tests:
* Converting to a public topic
* Unpinning unlisted topic
* selecting posts
* select below
* View Hidden Replies
* Quoting a quote keeps the original poster name
* Quoting a quote of a different topic keeps the original topic title
* Quoting a quote with the Reply button keeps the original poster name
* Quoting a quote with replyAsNewTopic keeps the original poster name
* Quoting by selecting text can mark the quote as full
2021-03-25 15:04:51 +01:00
Osama Sayegh c028745468
FIX: Allow pasting invitees in invite modal (#12520)
Meta topic: https://meta.discourse.org/t/pasting-email-in-share-a-thread-box-stopped-working/180919?u=osama.
2021-03-25 16:24:40 +03:00
Osama Sayegh f74785f758
FIX: Composer save button should be ✏ Save Edit when editing a PM post (#12521)
Meta topic: https://meta.discourse.org/t/edits-on-private-messages-should-generate-a-notification/182370/4?u=osama.
2021-03-25 16:24:22 +03:00
David Taylor f637bf1b58
DEV: Deprecate `message` parameter in auth provider plugin API (#12523)
This has been unused since d2bceff133
2021-03-25 13:23:48 +00:00
Jarek Radosz 9eb7c37098
FIX: Make mobile back/forward keybinds work for anons (#12512)
You don't need to be logged in to browse a forum in Discourse Hub 😃
2021-03-24 23:51:51 +01:00
Penar Musaraj e4f3a04d53
DEV: Move color definition functions to mixins (#12511) 2021-03-24 18:35:52 -04:00
Penar Musaraj b8822c7a87
DEV: Skip composer duplicate link test (#12509) 2021-03-24 15:25:31 -04:00
Penar Musaraj ee17ca9dc6
FIX: 404 error when editing an expanded reply (#12504) 2021-03-24 10:22:27 -04:00
Jarek Radosz be5ed73f08
UI: Make sure staff logs don't break the layout (#12494)
Prevents accidental layout stretching in `/admin/logs/staff_action_logs`
2021-03-23 22:08:28 +01:00
Arpit Jalan dc73aadbff
FIX: bulk "archive" and "move to inbox" for group messages was broken (#12488) 2021-03-23 21:34:47 +05:30
Bianca Nenciu d7bd62d9cf
FIX: Replace censored watched word consistently (#12486)
Applying oneboxes and replacing censored watched words does not happen
in a strict order which often lead to inconsistencies. This commit
fixes the behavior and will never censor oneboxes.

To make it always censor oneboxes implies significant changes to the
PrettyText pipeline.
2021-03-23 13:09:24 +02:00
Nacho Caballero deb9e3cd22
Fix CSS for collapsed table cells when showing insertion in Raw mode (#12489) 2021-03-23 10:43:25 +01:00
Bianca Nenciu 2ad9b3f432
FEATURE: Add anchor links to headings (#12379) 2021-03-23 10:45:06 +02:00
Bianca Nenciu e48d055232
FIX: Do not show duplicate_link notice for quotes (#12481)
Quoting a link from the topic would show a false duplicate_link notice.
2021-03-23 10:43:55 +02:00
Martin Brennan bcd6efa98c
FIX: Never display the invite show page form if DiscourseConnect enabled (#12466)
This form does not need to show if discourse connect is enabled
because generally the fields that would be filled in here are
filled in by the SSO provider. There is also an issue right now
where enable_local_logins and enable_discourse_connect can be
true at the same time which is not right.
2021-03-23 09:02:07 +10:00
Bianca Nenciu 437c9a554b
FEATURE: Import and export watched word (#12444)
Find & Replace and Autotag watched words were not completely exported
and import did not work with these either. This commit changes the
input and output format to CSV, which allows for a secondary column.

This change is backwards compatible because a CSV file with only one
column has one value per line.
2021-03-22 22:32:18 +02:00
Roman Rizzi ccc44baa10
FEATURE: Add a typographer rule to replace (pa) with ¶. (#12478) 2021-03-22 15:04:08 -03:00
Jarek Radosz 3e586ab25a
FIX: Don't attempt to delete non-existent bookmark (#12473)
Could happen when using the keyboard shortcut. ("d d")
2021-03-22 18:25:34 +01:00
Roman Rizzi e4ec0da714
FIX: Anons should see the Topic slow mode notice. (#12460) 2021-03-22 13:55:45 -03:00
Bianca Nenciu ec7415ff49
FEATURE: Check email availability in signup form (#12328)
* FEATURE: Check email availability on focus out

* FIX: Properly debounce username availability
2021-03-22 17:46:03 +02:00
Joffrey JAFFEUX 4fb2d397a4
FIX: ensures popper's autocomplete instance is destroyed (#12476) 2021-03-22 16:19:36 +01:00
Joffrey JAFFEUX 15a9a85f0a
FIX: ensures invisible link is not interfering with UI/tab order (#12472) 2021-03-22 12:51:18 +01:00
Joffrey JAFFEUX 2b5046af19
FIX: a never created listener was removed (#12469) 2021-03-22 09:58:59 +01:00
Joffrey JAFFEUX c3e76da90a
DOC: document addShortcut click option (#12467) 2021-03-22 09:51:45 +01:00
Joffrey JAFFEUX 4857891ecf
DEV: correctly defines focusComposer shortcut as shift+c (#12468) 2021-03-22 09:46:38 +01:00
Kris 9526c1a27b
FEATURE: Add `admin-area` class to HTML tag (#12459) 2021-03-22 11:36:26 +11:00
Robin Ward 942ee1e218
FIX: Tests were broken in Firefox (#12456)
There are a lot of little fixes to tests here, but the biggest issue was
too much recursion because we kept replacing the helpers over and over
again. I assume Chrome has tail recursion or something to speed this up
but Firefox hated it.

Otherwise, we can't rely on the order of attributes in rendered HTML so
I simplified most of those tests to just look for key strings in the
HTML that are rendered.
2021-03-22 11:35:51 +11:00
Penar Musaraj d898e00242
FIX: Clear draft modal correctly when switching topics (#12458)
Fixes an issue where the "Keep editing" button in the discard draft
modal wouldn't work when switching to a new topic with an open composer
and clicking Reply.

Followup to d470e4f
2021-03-22 11:32:19 +11:00
Martin Brennan 49f4c548ef
FEATURE: Bookmark pinning (#12431)
Users can now pin bookmarks from their bookmark list. This will anchor the bookmark to the top of the list, and show a pin icon next to it. This also applies in the nav bookmarks panel. If there are multiple pinned bookmarks they sort by last updated order.
2021-03-22 09:50:22 +10:00
Roman Rizzi e3d86c4e35
FIX: Only refresh the review count when the user can see the review queue. (#12453)
We currently make an AJAX request every time someone opens the hamburger menu, resulting in a forbidden response when a user can't see the review queue.
2021-03-19 16:20:41 -03:00
Dan Ungureanu 534008ba24
FIX: Improve handling when email is obfuscated (#12450)
This commit ensures that email validation is skipped when the email is
obfuscated, that the email is no longer send when it is not an invite
link and no username is suggested if the email is hidden as it may
reveal the first part of the email.

Follow up to commit 033d6b6437.
2021-03-19 17:15:46 +02:00
Osama Sayegh c9923a3e3e
UX: Composer actions menu header should display the icon of selected action (#12449)
See a video of the change in the PR: https://github.com/discourse/discourse/pull/12449.
2021-03-19 17:48:43 +03:00
Robin Ward 5b02aad9c1
Support for Testem in Ember CLI (#12442)
* DEV: Use custom tags rather than handlebars server side

These will be skipped if they are ever rendered in a document. The
handlebars really messes stuff up.

* DEV: Build our own locale file for testing purposes

We can't practically proxy everything in test mode, but we can
approximate the logic and build our own locale file for testing purposes
that works quite well. This allows us to run tests without a proxy.

* DEV: Support for testem runner for ember cli tests
2021-03-19 09:32:46 -04:00
Penar Musaraj d470e4fade
FEATURE: Allow users to save draft and close composer (#12439)
We previously included this option conditionally when users were replying
or creating a new topic while they had content already in the composer.

This makes the dialog always include three buttons:
  - Close and discard
  - Close and save draft for later
  - Keed editing

This also changes how the backend notifies the frontend when there is
a current draft topic. This is now sent via the `has_topic_draft`
property in the current user serializer.
2021-03-19 09:19:15 -04:00
Robert 4dcdbd7801
REFACTOR: break search results in multiple sub components
This change will introduce:
- search-result-entries
- search-result-entry

making the full-page-search template easier and less risky to override.
2021-03-19 10:49:14 +01:00
Martin Brennan 355d51afde
FEATURE: Allow using invites when DiscourseConnect SSO is enabled (#12419)
This PR allows invitations to be used when the DiscourseConnect SSO is enabled for a site (`enable_discourse_connect`) and local logins are disabled. Previously invites could not be accepted with SSO enabled simply because we did not have the code paths to handle that logic.

The invitation methods that are supported include:

* Inviting people to groups via email address
* Inviting people to topics via email address
* Using invitation links generated by the Invite Users UI in the /my/invited/pending route

The flow works like this:

1. User visits an invite URL
2. The normal invitation validations (redemptions/expiry) happen at that point
3. We store the invite key in a secure session
4. The user clicks "Accept Invitation and Continue" (see below)
5. The user is redirected to /session/sso then to the SSO provider URL then back to /session/sso_login
6. We retrieve the invite based on the invite key in secure session. We revalidate the invitation. We show an error to the user if it is not valid. An additional check here for invites with an email specified is to check the SSO email matches the invite email
7. If the invite is OK we create the user via the normal SSO methods
8. We redeem the invite and activate the user. We clear the invite key in secure session.
9. If the invite had a topic we redirect the user there, otherwise we redirect to /

Note that we decided for SSO-based invites the `must_approve_users` site setting is ignored, because the invite is a form of pre-approval, and because regular non-staff users cannot send out email invites or generally invite to the forum in this case.

Also deletes some group invite checks as per https://github.com/discourse/discourse/pull/12353
2021-03-19 10:20:10 +10:00
Penar Musaraj aee7ef0dc9
DEV: Fix build due to highlight.js branch issue (#12441)
Highlight.js changed their default branch from master to main. This switches to the @highlightjs/cdn-assets package, thus sidestepping the problem. It's a slightly cleaner integration though (no need to build locally anymore).
2021-03-18 18:21:23 -04:00
jbrw aaf96edee0
FIX: all staff members (regardless of TL) should be able to pin/unpin topics (#12435) 2021-03-18 15:32:42 -04:00
Joffrey JAFFEUX 67e1ae3f7d
A11Y: makes search results count readable by screen reader (#12437) 2021-03-18 18:44:26 +01:00
Dan Ungureanu da1e37d2ce
FIX: browser-update should work with old browsers (#12436)
This caused issues in IE10 / IE11 with compatibility mode.
2021-03-18 19:09:01 +02:00
Dan Ungureanu 5024ea72d2
UX: Show first unique letters in invite link (#12434) 2021-03-18 19:05:38 +02:00
Roman Rizzi da210b6d77
FEATURE: Replace markdown-it replacements rule. (#12417)
We override the default replacements rule to no longer replace "(c)", "(p)", and "(p)". Additionally, we merged the custom arrows rule into the replacement function.
2021-03-18 10:55:41 -03:00
Bianca Nenciu 1a433193d1
FIX: Do not treat code tag as block level element (#12432)
When syncing code elements, the inner text used to be escaped, which
rendered the actual HTML code instead. This commit overwrites default
parser settings to fix the way code tags are handled.
2021-03-18 15:30:15 +02:00
Joffrey JAFFEUX cf703ccf66
A11Y: improves avatar menu focus/active states (#12422) 2021-03-18 13:29:27 +01:00
Kris 7e470bf8ae
UX: Improve topic footer alignment and layout (#12420) 2021-03-17 22:42:52 -04:00
Jordan Vidrine 74dbf2b1dc
UX: Move modal footer into better container (#12429)
* UX: Move modal footer into better container

This commit moves the modal footer under the sign-up form for a more cohesive feel between the login + create account modals.
2021-03-17 14:10:49 -05:00
Robin Ward 11e6e9cca2
FIX: Tests in `admin/tests` were not running (#12391)
Since we want to run them in the core app they've been moved into the
`tests` directory for discourse, and updated to the latest format.
2021-03-17 13:02:12 -04:00
Joffrey JAFFEUX 482bcc8726
A11Y: associates lists with labels on interface page (#12426) 2021-03-17 16:03:09 +01:00
Joffrey JAFFEUX cb0427ffdf
A11Y: links change username input to its label (#12424) 2021-03-17 15:47:27 +01:00
Bianca Nenciu 9b4b2149ff
FIX: Allow group owners manage group flair (#12415)
Follow up to commit 901cee55cd.
2021-03-17 16:35:51 +02:00
Osama Sayegh d56b2e85aa
FIX: Escape Font Awesome icons (#12421)
This is not a security issue because regular users are not allowed to insert FA icons anywhere in the app. Admins can insert icons via custom badges, but they do have the ability to create themes with JS.
2021-03-17 16:11:40 +03:00
Osama Sayegh a23d0f9961
UX: Add image uploader widget for uploading badge images (#12377)
Currently the process of adding a custom image to badge is quite clunky; you have to upload your image to a topic, and then copy the image URL and pasting it in a text field. Besides being clucky, if the topic or post that contains the image is deleted, the image will be garbage-collected in a few days and the badge will lose the image because the application is not that the image is referenced by a badge.

This commit improves that by adding a proper image uploader widget for badge images.
2021-03-17 08:55:23 +03:00
Kris 26bfb5d6b9
UX: reduce opacity of code copy button (#12418) 2021-03-16 19:22:35 -07:00
Robin Ward 37c42a57b0
DEV: Make `dockcontainer` and `hidepassed` the defaults (#12416)
This makes running qunit tests in a browser much simpler
2021-03-16 14:34:59 -04:00
Dan Ungureanu eda8a839d4
UX: Show Topic column in invites pending tab (#12413) 2021-03-16 16:29:41 +02:00
Robin Ward 1c82ed9f3e
REFACTOR: Use a `<script src>` tag to start the app (#12401)
This is to help with potential CSP issues.
2021-03-16 09:36:11 -04:00
Roman Rizzi dc3af285b2
UX: Show the `Dismiss New` button at the top of the topics. (#12403)
We want to be consistent across desktop and mobile.
2021-03-16 10:07:04 -03:00
Dan Ungureanu 790c4ad4a7
FEATURE: Improve expired invites tab (#12392)
This commit extends functionality of the expired invites tab, making
it more similar to the pending tab. It also implements a different
layout for mobile.
2021-03-15 11:52:58 +02:00
Kris 01babeccdf
FEATURE: Add above-timeline plugin outlet (#12373) 2021-03-12 18:40:51 -05:00
Blake Erickson 85870225f2
FIX: Allow additional valid theme .git url formats (#12385)
Some git repos have a different ssh url scheme than github and we should
support them.

This change updates our regex format to account for repos that don't
start with "git", but are still valid ssh urls.

Also I added some tests to account for the various formats and to ensure
we don't show the public key when using https urls.

See: https://meta.discourse.org/t/182668
2021-03-12 13:24:55 -07:00
Dan Ungureanu 53158c0542
FIX: Show link in invite panel (#12378) 2021-03-12 17:09:05 +02:00
Robin Ward c60cdab1fe
FIX: Invite acceptance tests were broken in Ember CLI (#12367)
* FIX: Invite acceptance tests were broken in Ember CLI

They relied on old Ember behavior where the app does not boot until
`visit` is called and this is no longer true.

This refactors the test to DRY stuff up a bit, and modify the DOM where
necessary in `needs.hooks.beforeEach`.

* Update app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js

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

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-03-12 09:00:39 -05:00
Jordan Vidrine f1c1f9e0e7
UX: Add class to body on first unread notification (#12362)
* UX: Add class to body on first unread notification

This commit adds `first-notification` class to the body element when there is a first unread notification. This will fix any issues with certain themes who use custom headers where z-index issues sometimes cause those custom headers to not be hidden by the transparent shadow over the page.
2021-03-11 16:10:40 -06:00
Neil Lalonde b42ee6e296
DEV: add classes to invite modal fields so they can be targeted (#12366) 2021-03-11 15:56:02 -05:00
Rafael dos Santos Silva 52810713d3
FEATURE: Enable contact picker on new invite modal (#12364) 2021-03-11 17:10:18 -03:00
Robin Ward 7036346965
A couple important Ember CLI fixes (#12345)
* FIX: Error related to sending headers twice

* FIX: Insert correct bootstrap contents in test runner html and boot
2021-03-11 14:40:25 -05:00
Arpit Jalan 3eb769d03b
UX: respect "prioritize username in ux" setting wherever possible (#12357)
This commit ensures that "prioritize username in ux" setting is
respected in following places:

- user directory
- user summary
- badge detail
- group detail
2021-03-11 21:55:14 +05:30
Roman Rizzi 8fcad73b36
FEATURE: Admins can flag posts so they can review them later. (#12311)
Staff can send a post to the review queue by clicking the "Flag Post" button next to "Take Action...". Clicking it flags the post using the "Notify moderators" score type and hides it. A custom message will be sent to the user.
2021-03-11 08:21:24 -03:00
Martin Brennan 593edc43c5
FEATURE: Add tag-custom-settings plugin outlet (#12355)
So plugin developers can add extra settings to the tag UI.
2021-03-11 16:45:35 +10:00
Kris 83519e7f3a
FEATURE: Always show tag dropdown when tagging is enabled (#12209) 2021-03-10 21:13:15 -05:00
Martin Brennan b81bb2f93b
FIX: Nav items not recomputing on query param change (#12350)
The recalculation of the `forceActive` function for the nav items was being run _before_ the querystring parameters are getting updated. For example for the Unassigned link:

```javascript
i.addNavigationBarItem({
  name: "unassigned",
  customFilter: (category) => {
    return category && category.enable_unassigned_filter;
  },
  customHref: (category) => {
    if (category) {
      return getURL(category.url) + "/l/latest?status=open&assigned=nobody";
    }
  },
  forceActive: (category, args, router) => {
    const queryParams = router.currentRoute.queryParams;

    return (
      queryParams &&
      Object.keys(queryParams).length === 2 &&
      queryParams["assigned"] === "nobody" &&
      queryParams["status"] === "open"
    );
  },
  before: "top",
});
```

When forceActive is hit going from e.g.`http://localhost:3000/c/some-category/5/l/top` to `http://localhost:3000/c/some-category/5/l/latest?assigned=nobody&status=open` the `queryParams` are empty and the URL does not seem to change until after the transition and so `active` ends up being false in this `navigation-item` function which controls whether or not to do the highlight:

```javascript
@discourseComputed("content.filterType", "filterType", "content.active")
active(contentFilterType, filterType, active) {
  if (active !== undefined) {
    return active;
  }
  return contentFilterType === filterType;
},
```

Also sometimes this is not even recalculated, for example going from `http://localhost:3000/c/some-category/5/l/latest?status=open` to `http://localhost:3000/c/some-category/5/l/latest?assigned=nobody&status=open`. This PR fixes the issue where the query parameters changing was not forcing this recalculation. This was especially noticable in conjunction with https://github.com/discourse/discourse-loading-slider.
2021-03-11 11:50:05 +10:00
Penar Musaraj 10780d2448
DEV: support json_schema in theme settings (#12294) 2021-03-10 20:15:04 -05:00
Neil Lalonde 3cd26cc9d7
UX: pasting a twitter link into composer title will not set the title (#12332)
The title of Twitter oneboxes is always the name of the Twitter user,
which is not a descriptive topic title. Leave the title field blank so
that users must enter their own title.
2021-03-10 15:49:56 -05:00
Robin Ward e429af8220
FIX: QUnit tests could time out based on load order (#12342)
By default our QUnit test runner starts automatically. This is normally
fine but for our `run-qunit.js` script we add a bunch of QUnit events
using `eval` and sometimes those events were added after the tests
already started/finished resulting in a hang.

This adds a new parameter that will cause QUnit not to run
automatically, which the runner uses, then triggers a `start()` when it
knows it's ready.
2021-03-10 13:32:20 -05:00
Penar Musaraj b3bcf2769a
UX: Consistent labels in invite form (#12339) 2021-03-10 12:27:53 -05:00
Penar Musaraj de6474a85f
DEV: Update highlight.js dependency to 10.6.0 (#12303) 2021-03-10 11:35:00 -05:00
Penar Musaraj 4071af1d09
DEV: Refactor font and category background importers (#12312) 2021-03-10 11:05:56 -05:00
David Taylor a52a863fc9
FIX: Ensure the signup boolean is passed when started via _autoLogin (#12338)
The signup boolean was being passed in the third _autoLogin argument, when it should have been the fourth. The third parameter to _autoLogin was optional, which is confusing. This commit cleans things up so both optional arguments are supplied via keywords.

Followup to cbef2ba151
2021-03-10 15:39:14 +00:00
Robin Ward 55007c0621
FIX: Flaky JS tests (#12331)
If you were unlucky and tested a mobile raw template before a desktop
raw template, it would keep using the mobile one resulting in failures.
2021-03-10 08:27:42 -05:00
Bianca Nenciu c0421e4586
FEATURE: Implement bulk operations for PMs (#12286) 2021-03-10 14:49:38 +02:00
Bianca Nenciu 990a26d14b
FIX: Add translation string for clear all watched words (#12336) 2021-03-10 14:48:13 +02:00
David Taylor cbef2ba151
DEV: Pass signup=true to auth providers when signup buttons used (#12337)
This allows auth provider plugins to behave differently for login / signup. Previously, there was no way for them to know which button had been used.

This change will be a no-op in the majority of cases. If auth plugins wish to make use of this new feature, they should check for ?signup=true in the URL. For example: https://github.com/discourse/discourse-oauth2-basic/pull/34
2021-03-10 12:16:21 +00:00
Alan Guo Xiang Tan a1df45c6bc UX: Fix broken styling on login modal when local login is disabled. 2021-03-10 15:53:22 +08:00
Kris e9a05ce161
UX: login; smaller titles, more consistent spacing, other fixes (#12317)
* Fixes an issue where long translations cause layout issues

* Fixes an issue where the alignment shifts when switching between signup/login

* Makes some of the margin/padding more consistent

* Removes duplicate .login-modal and .create-account classes and replaces them with .login-modal-body and .create-account-body

* Adds another color transformation so we could remove prefers-color-scheme... the problem with that was that my OS' UI might be set to something different than my Discourse preferences (prefers-color-scheme only responds to OS UI settings)
2021-03-09 17:00:46 -05:00
jbrw ac7773a30d
FEATURE: allow category group moderators to pin/unpin topics (#12325)
* FEATURE: allow category group moderators to pin/unpin topics

Category group moderators should be able to pin/unpin any topics within a category where they have appropraite category group moderator permissions.
2021-03-09 16:05:11 -05:00
Robin Ward 7435d55ea6
DEV: Use Ember CLI middleware to decorate the index template (#12292)
* DEV: Use Ember CLI middleware to decorate the index template

Previously we'd do this on the client side which did not support our
full plugin API. Now requests for the index template will contact the
dev server for a bootstrap.json and apply it to the current template.

* FIX: Allows logins in development mode for Ember CLI
2021-03-09 10:09:35 -05:00
Dan Ungureanu 687e09c885
UX: Minor improvements to invites (#12324)
* FIX: Show resend button only if an email was sent

Otherwise, show the "save and send email" button.

* UX: Copy change

* UX: Show feedback when link was copied
2021-03-09 16:56:18 +02:00
Bianca Nenciu 08f169ddd4
UX: Remove duplicate title from watched words page (#12321) 2021-03-09 11:52:12 +02:00
Alan Guo Xiang Tan 1106aee152 FIX: Incorrect parameter when using omniauth providers on invites page.
Follow-up to ce04db8610
2021-03-09 13:54:33 +08:00
Alan Guo Xiang Tan ce04db8610 FEATURE: Allow invites redemption with Omniauth providers. 2021-03-09 09:27:18 +08:00
Jordan Vidrine 082a77df69
UX: Add class to email div on login (#12310)
This commit adds a `create-account-email` class to the email div of the create account modal.
2021-03-08 17:33:05 -05:00
Kris 8fb28ae365
UX: fix bulk select button height on search page (#12301) 2021-03-08 17:22:13 -05:00
Dan Ungureanu fecf3e20d9
FEATURE: Various improvements to invite system (#12314)
* FEATURE: Do not delete invite if link was copied

* FIX: Show error to user if invite redeeming fails

The error was only displayed to console.

* UX: Better placement of bulk buttons

Destroy all expired invites should be on the expired tab, not pending.

* FIX: Ensure invited_groups is unique per invite and group

* FIX: Do not refresh topic list if title unchanged

* FIX: Do not close modal on enter

This intereferes with the group and topic chooser.
Wrapping everything in a form disables this behavior.

* FIX: Move link and email options outside advanced section

* FIX: Do not close modal if saving a link invite

User may still want to copy the link.
2021-03-09 00:15:14 +02:00
Robert 0da649e4fa
DEV: add new plugin outlet to tags template (#12302) 2021-03-08 13:02:51 -05:00
Kris 3e3bae59f6
UX: clean up tag styles to improve alignment (#12300) 2021-03-08 10:52:39 +11:00
Dan Ungureanu 7f3240ea31
FEATURE: Various improvements to invite system (#12298)
* FIX: Do not show expired invites under Pending tab

* DEV: Controller action was renamed in previous commit

* FEATURE: Add 'Expired' tab to invites

* FEATURE: Refresh model after removing expired invites

* FEATURE: Do not immediately add invite to the list

Opening the 'create-invite' modal used to automatically generate an
invite to reserve an invite link. If the user did not save it and
closed the modal, the invite would be destroyed. This operations caused
the invite list to change in the background and confuse users.

* FEATURE: Sort redeemed users by creation time

* UX: Improve show / hide advanced options link

* FIX: Show redeemed users even if invites were trashed

* UX: Change modal title when editing invite

* UX: Remove Get Link button

Users can get it from the edit modal

* FEATURE: Add limit for invite links generated by regular users

* FEATURE: Add option to skip email

* UX: Show better error messages

* FIX: Show "Invited by" even if invite was trashed

Follow up to 1fdfa13a099d8e46edd0c481b3aaaafe40455ced.

* FEATURE: Add button to save without sending email

Follow up to c86379a465f28a3cc64a4a8c939cf32cf2931659.

* DEV: Use a buffer to hold all changed data

* FEATURE: Close modal after save

* FEATURE: Rate limit resend invite email

* FEATURE: Make the save buttons smarter

* FEATURE: Do not always send email even for new invites
2021-03-06 13:29:35 +02:00
Osama Sayegh 5d95b68727
FEATURE: Add newly loaded topics to bulk-select automatically if Select All is on (#12026)
Currently it's very tedious to bulk select hundreds of topics in a topic list -- each time a new batch of topics is loaded you have to scroll all the way to the top to click the `Select All` button and scroll back down to load the next batch, or you have to tick each topic individually.

This commit should make that process a lot easier because we will now remember if the `Select All` button was clicked and so whenever a new batch of topics is loaded, they'll automatically be selected.

Meta topic: https://meta.discourse.org/t/add-select-all-controls-at-the-bottom-of-the-list/178020/2?u=osama.
2021-03-05 17:16:03 +03:00
Renato Atilio 9f474b1c1c
FIX: subfolder prefix should work even if url starts with the prefix (#12284)
Issue was reported on https://meta.discourse.org/t/-/181798

DEV: test getURL for urls starting with the prefix without trailing slash
2021-03-04 16:46:22 -05:00
Alan Guo Xiang Tan 4a41f72f09 DEV: DRY up wavingHandUrl code.
Allows for resuse in other controllers and components.
2021-03-04 15:18:54 +08:00
Rafael dos Santos Silva 42a440f5f9
FIX: Typo in emoji path caused by 83f332b (#12279) 2021-03-03 16:18:49 -03:00
Roman Rizzi 5276d432aa
A11Y: Switch tabs using the keyboard (#12262)
* Revert "Revert "A11Y: Switch tabs using the keyboard (#12241)" (#12260)"

This reverts commit 4c1e02d412.

* FIX: Make sure that the "menu-link" is present when a plugin adds a tab.

Other changes:

- We put the notification tab first using JS instead of CSS. It's important because of the tab number data attribute, which the keyboard navigation uses.
- We only set the button id from the attrs object if it's a tab. Otherwise, it conflicts with the topic footer button
2021-03-03 14:37:40 -03:00
Bianca Nenciu 1fc67cc26a
FIX: Remove list double padding (#12275)
Enabling support_mixed_text_direction added both left-side and
right-side padding.

Follow up to 4bee7fb458.
2021-03-03 18:09:48 +02:00
Dan Ungureanu c047640ad4
FEATURE: Various improvements to invite system (#12023)
The user interface has been reorganized to show email and link invites
in the same screen. Staff has more control over creating and updating
invites. Bulk invite has also been improved with better explanations.

On the server side, many code paths for email and link invites have
been merged to avoid duplicated logic. The API returns better responses
with more appropriate HTTP status codes.
2021-03-03 11:45:29 +02:00
Bianca Nenciu 039d0d3641
FEATURE: Move security related user preferences to different tab (#12264) 2021-03-03 11:09:22 +02:00
Bianca Nenciu b49b455e47
FEATURE: Autotag watched words (#12244)
New topics with be matched against a set of watched words and be
tagged accordingly.
2021-03-03 10:53:38 +02:00
Martin Brennan 8d38438725
FIX: Sort topic timer and bookmark time options (#12270)
remove 3 month option for topic timer
move relative time input inside the custom
date and time shortcut
make sure special options are always at the bottom
2021-03-03 13:33:47 +10:00
Martin Brennan 31fab3f84d
FEATURE: Add year to relative time picker (#12268)
Add a new year interval option to relative time picker, and also fix some rounding issues (Math.floor is not ideal because it gets rid of half days etc.)

Also adding some component tests here for relative-time-picker.
2021-03-03 11:41:07 +10:00
Kris e180f3f97a
UX: restore autofocus on login inputs (#12266) 2021-03-02 14:30:53 -05:00
Rafael dos Santos Silva 83f332b5a5
FEATURE: Add a site setting to allow emojis to come from an external URL (#12180) 2021-03-02 16:04:16 -03:00
Mark VanLandingham 4adce0d844
DEV: APIs for plugin to add custom reviewable confirm modal (#12246) 2021-03-02 10:28:27 -06:00
Roman Rizzi 4c1e02d412
Revert "A11Y: Switch tabs using the keyboard (#12241)" (#12260)
This reverts commit de10c39fa4.
2021-03-02 13:17:36 -03:00
Roman Rizzi de10c39fa4
A11Y: Switch tabs using the keyboard (#12241)
* A11Y: Switch tabs using the keyboard

According to the WAI-ARIA Authoring Practices, tabs should be navigable using the left/right arrow keys.

Additionally, the screen reader couldn't correctly announce that a tab was selected when clicking the tab icon. To fix this, we made the SVG icon non-clickable and set the "aria-hidden" attribute to true.

* Handle navigation events using appEvents
2021-03-02 12:22:32 -03:00
Bianca Nenciu 6217b0b53b
FIX: Add href to user avatar in group cards (#12250) 2021-03-02 16:54:22 +02:00
Martin Brennan 31f3563f2d
FIX: CSS tweaks so bookmark + timer modal work on mobile (#12253)
Previously the timer modal was too wide and the bookmark modal too narrow.
2021-03-02 16:55:41 +10:00
Robin Ward c0624d45db
FIX: Add appropriate classes to `html` element including `lang` (#12245)
This was not working in the Ember CLI version of the application.
2021-03-01 14:04:02 -05:00
Jordan Vidrine 3019b6d8d2
FIX: 100% Width for logout button (#12243)
This commit sets the width for the logout button to be 100% to allow for clicking outside of the text to still work as expected.
2021-03-01 11:09:50 -06:00
Penar Musaraj 6809cccd88
DEV: Add experimental json_scheme site setting type (#12226) 2021-03-01 09:15:17 -05:00
Robin Ward 1bbf324415
FIX: When using Ember CLI theme Javascript/HTML was not being inserted (#12227)
This also supports plugins with custom HTML.
2021-02-26 13:00:31 -05:00
Penar Musaraj aa1442fdc3
DEV: Use separate files for theme component stylesheets (take 2) (#12225)
This switches to outputting a separate file for each theme component CSS
asset. We have separate CSS plugin files, separate JS files
(for plugins/themes/components), it makes sense to do the same for
component CSS assets.

Benefits:
- easier debugging
- fixes a regression with theme component sourcemaps
- changes to theme components are updated individually

With HTTP/2, there is also no performance downside to having additional
files in the initial request.
2021-02-26 12:30:23 -05:00
Vinoth Kannan 0581c033d7
FIX: incorrect URL for tag pages inside category in subfolder setup. (#12222)
Previosuly, we didn't use `getURL` method to include the subfolder prefix in these places.
2021-02-26 22:44:34 +05:30
Penar Musaraj e74bdfdf8e
Revert "DEV: Use separate files for theme component stylesheets (#12214)" (#12224)
This reverts commit f57a49c2f9.

This had some unexpected side effects, needs some more work.
2021-02-26 08:20:39 -05:00
Penar Musaraj 45c5fd2172
DEV: Remove JoyPixels emoji option (#12197)
- removes the option from site settings
- deletes the site setting on existing sites that have it
- marks posts using emojis as requiring a rebake

Note that the actual image files are not removed here, the plan is to
remove them in a few weeks/months (when presumably the rebaking of old
posts has been completed).
2021-02-26 07:44:52 -05:00
Penar Musaraj f57a49c2f9
DEV: Use separate files for theme component stylesheets (#12214)
This switches to outputting a separate file for each theme component CSS
asset. We have separate CSS plugin files, separate JS files
(for plugins/themes/components), it makes sense to do the same for
component CSS assets.

Benefits:
- easier debugging
- fixes a regression with theme component sourcemaps
- changes to theme components are updated individually

With HTTP/2, there is also no performance downside to having additional
files in the initial request.
2021-02-26 07:44:15 -05:00
Kris 3f21d41b09
2FA fixes for login modal (#12221) 2021-02-26 00:33:34 -05:00
Arpit Jalan ae70a23525
FIX: ignore enter key press on "move to existing post" search field (#12210)
UX: do not set focus on auto-selected radio option
2021-02-25 23:41:12 +05:30
Bianca Nenciu 533800a87b
Add watched words of type "replace" (#12020)
This commit includes other various improvements to watched words.

auto_silence_first_post_regex site setting was removed because it overlapped
with 'require approval' watched words.
2021-02-25 14:00:58 +02:00
Kris e3e8fd4f7c
FIX: login modal max-width wasn't specific enough (#12207)
follow up to 362dd79
2021-02-24 18:32:40 -05:00
Krzysztof Kotlarek 57bfc398d4
FIX: paste table with multiline cell (#12194)
When a cell is multiline, it is wrapped with quotes. It can be used to determine if it is a "real" new line or not.

Meta: https://meta.discourse.org/t/pasting-google-sheets-table-with-a-cell-that-contain-a-line-break/173106
2021-02-25 09:39:54 +11:00
Kris 362dd798ae
UX: add link for email login below username, remove button (#12118) 2021-02-24 16:30:08 -05:00
Osama Sayegh a6850d9691
FIX: Detect installed themes using URLs instead of names (#12201)
Context: https://meta.discourse.org/t/not-all-installed-theme-components-listed-as-installed/179756?u=osama
2021-02-25 00:10:17 +03:00
Neil Lalonde 7c45ff6659
DEV: new plugin API to change default new category colors (#12200)
api.setNewCategoryDefaultColors(
  'FFFFFF', // background color
  '000000'  // text color
)
2021-02-24 16:00:50 -05:00
Bianca Nenciu dc7e3fab50
FIX: Pass ajax function to loadOneboxes (#12199)
When enable_diffhtml_preview is true, oneboxes failed to load because a
wrong parameter was passed.

This commit also unhides enable_diffhtml_preview.
2021-02-24 21:42:09 +02:00
Jarek Radosz daf34ae7e2
DEV: Fix settings/interface UI breaking on Ember CLI (#12154)
Fixes failures in user-preferences-interface-test on Ember CLI.

Included:
* DEV: User themes have `theme_id` not `id`
* FIX: `themeId` could point to a non-existent theme
* DEV: Add request stub

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2021-02-24 16:14:06 +01:00
David Taylor d22ab6fe22
FIX: Ensure badge description is updated when routing without loading state (#12196) 2021-02-24 10:16:47 +00:00
Martin Brennan f2126acf5a
FIX: Allow entering blank values in relative-time-picker (#12193)
In certain cases such as the category auto-close hours setting, it makes sense to blank out the relative time picker duration so 
`null` is sent to the server to clear the value.

Meta example: https://meta.discourse.org/t/how-do-i-disable-topic-auto-close/180487
2021-02-24 13:25:26 +10:00
Bianca Nenciu 845987ce23
FIX: Improve error message when login_required sites are under load
Previously a confusing message would pop up making private communities thing that anonymous access is granted.
2021-02-24 13:25:55 +11:00
Penar Musaraj c0fd4ab9d6
DEV: Remove deprecated plugins variables importer (#12168) 2021-02-23 16:20:59 -05:00
Penar Musaraj bd679b95a7
UX: Remove redundant focus style (#12192)
This style is unnecessary because text inputs and textareas have
focus styles set elsewhere (lines 228 and 288 respectively) and we don't
have any `select` elements.
2021-02-23 16:20:39 -05:00
Penar Musaraj 76967ee788
UX: use default browser focus styling for checkbox and radio inputs (#12173) 2021-02-23 14:01:02 -05:00
Penar Musaraj e58922e1e3
UX: Styling adjustments for admin new features (#12189)
- Fixes an alignment issue when emojis have varying widths
- Adjusts mobile alignment
2021-02-23 11:58:20 -05:00
Roman Rizzi 4bc3a64982
A11Y: Improve the header menu "view all" title. (#12175)
* A11Y: Improve the header menu "view all" title.

The title attribute has been used to attempt to provide the link with an accessible name, but the value of the title attribute is “view all” for the link in each of the tabs, and so their purpose is not uniquely identified.
2021-02-23 12:24:42 -03:00
David Taylor 1844bde57c
FIX: Allow mobile-nav to work without loading transitions (#12184)
Previously, the `{{mobile-nav}}` component required a `currentRouteName` property, passed from the router service. It would observe changes in this property, and update the UI accordingly.

If we change between routes which have the same `currentRouteName` (e.g. two different group message inboxes), then the `currentRouteName` does not change and does not trigger the observer. Currently in core, we are relying on the fact that currentRouteName temporarily enters a `.loading` substate during a transition. This will change when we remove the loading substate in the near future.

This commit refactors `{{mobile-nav}}` to inject the router directly, and use the `routeDidChange` event instead of an observer. The change is backwards compatible, but plugins passing the old `currentPath` property will be shown a deprecation notice.
2021-02-23 11:16:40 +00:00
Osama Sayegh 0f807ba85b
UX: Allow select-kit to have an autofocus option (#12183)
On some modals the main/primary input field is a select-kit component (like `{{email-group-user-chooser}}` on the assign modal), so it makes sense to allow select-kit to steal focus on modals like these. This PR adds an `autofocus` option (default false) that allows select-kit to steal focus when it's rendered.
2021-02-23 13:20:32 +03:00
Kris 477930683b
UX: More consistent group mention style (#12156) 2021-02-22 19:02:47 -05:00
Neil Lalonde 9a72876863
DEV: add plugin outlets above and below discovery-categories (#12176) 2021-02-22 17:17:03 -05:00
Penar Musaraj 9063520d89
FIX: Avoid Safari service worker error on back navigation (#12171) 2021-02-22 14:11:20 -05:00
Penar Musaraj 0620f6298e
UX: Remove emoji step in wizard (#12169) 2021-02-22 12:14:18 -05:00
Jarek Radosz 3ba0a47e61
UX: Tweak `group` layout to fix button alignment (#12167)
Included:

* DEV: Span can't contains divs
* DEV: Drop extra elements
* UX: Tweak `group` layout to fix button alignment
* UX: Add space between "Members" and "(N)"
2021-02-22 16:06:52 +01:00
Jarek Radosz b693bf8ca0
FIX: Don't show "bulk" icon on group-index for unauthorized users (#12166)
Closes https://meta.discourse.org/t/group-management-tools-show-up-for-all-users/179259/9

Includes:
* DEV: Add missing <tr>
2021-02-22 15:29:04 +01:00
Jarek Radosz 858436b17c
DEV: Fix group-index-test under Ember CLI (#12153)
`:nth()` and `:first` are jQuery-only selectors and fail when used with `querySelector`/`querySelectorAll`.
2021-02-22 15:27:01 +01:00
Jarek Radosz 24f828c467
DEV: Scope `query` to the testing container (#12152)
We don't want it to find QUnit UI elements… This fixes some Ember CLI test failures.
2021-02-22 15:26:50 +01:00
Joffrey JAFFEUX d0d54bbead
A11Y: deselect focused choice when using enter in multi-select (#12165) 2021-02-22 14:34:31 +01:00
Joffrey JAFFEUX 74d83abcc7
A11Y: gives autocomplete in search a more accessible name (#12164)
s/discourse/discourse-search
2021-02-22 12:11:06 +01:00
Joffrey JAFFEUX b7dbdec6fb
A11Y: makes other and color, fieldset/legend elements (#12163) 2021-02-22 12:10:51 +01:00
Joffrey JAFFEUX 0b14eb6ab1
A11Y: makes edit username and avatar accessible (#12162)
This commit also adds name as a bindable attribute of link-to
2021-02-22 12:10:44 +01:00
David Taylor 863c7919d7
FIX: Close navigation dropdown when item selected (#12155)
This `if` statement was backwards, such that it was a no-op. This hasn't
caused a problem because clicking an item triggers a page load, which
destroys and recreates the component.

However, we are soon planning to remove the intermediate loading screen,
which means the component will not be removed/recreated.

https://meta.discourse.org/t/177939/202
2021-02-22 10:41:09 +00:00
Joffrey JAFFEUX 72258c663b
A11Y: ensures avatar image in site header has alt attribute (#12161) 2021-02-22 11:09:18 +01:00
Kris 47ef83505f
UX: make tag input full width for PMs (#12158) 2021-02-22 16:49:12 +11:00
Neil Lalonde da8b0818ef
DEV: add classes to sections in category settings (#12150)
Some had them, most didn't.
2021-02-19 15:28:19 -05:00
Rafael dos Santos Silva 5117f0a3e8
FIX: Subfolder replace should only affect URL prefix (#12135)
* FIX: Subfolder replace should only affect URL prefix

Issue was reported in https://meta.discourse.org/t/-/179504

* DEV: Test subfolder handling in get-url when called twice on the same path
2021-02-19 16:06:18 -03:00
Penar Musaraj 5604ce70d4
DEV: More refactoring of SCSS importers (#12143) 2021-02-19 11:22:24 -05:00
Penar Musaraj 7ee660a017
FIX: Sort admin dashboard new updates by latest (#12146) 2021-02-19 11:03:36 -05:00
Joffrey JAFFEUX 47835ade9a
UX: implements a new tags-intersection-chooser (#12139) 2021-02-19 13:46:02 +01:00
Martin Brennan 11f28e3eb3
FIX: Do not allow bookmarks to use post date in past for reminder (#12138)
See https://meta.discourse.org/t/bookmark-reminder-date-in-post-in-the-past/180128
2021-02-19 13:57:27 +10:00
Kris c3f6eb17a5
UX: On very short screens switch quick-access-profile to 2-columns (#12120) 2021-02-18 18:47:37 -05:00
Kris 77c8f0c864
UX: Show bullets for some composer lists (#12122) 2021-02-18 18:47:27 -05:00
Jordan Vidrine de119afec5
UX: Adjust padding on create account modal (#12133)
This commit adds padding to the top and bottom of the form on the create account modal.
2021-02-18 16:03:55 -06:00
Penar Musaraj 916e1d85cf
FEATURE: Quick theme installs via query parameters (#12128) 2021-02-18 12:51:44 -05:00
Joffrey JAFFEUX e175e17ebb
UX: publishes page, on public change, only when page is published (#12123) 2021-02-18 17:34:50 +01:00
Kris c6a9142dbb
FIX: remove top gradient from signup modal (#12121) 2021-02-18 08:12:28 -06:00
Jordan Vidrine 2aab306665
UX: Remove margin from security key login button (#12115)
This commit removes the right margin from the security key button in the login with security key screen.
2021-02-18 08:12:03 -06:00
Bianca Nenciu 08acf51be0
FEATURE: Use diffhtml to update composer preview (#11237)
Displaying videos, animated GIFs or any kind of rich content in preview
used to refresh on every keystroke, which could cause performance
problems.
2021-02-18 16:07:26 +02:00
Martin Brennan e0f0fe5624
FIX: Bump max topic timer duration to 20 years (#12107)
This way it has some sort of cap, even if it seems pretty
high, and we don't have to worry about requests for increasing
it from 2 to 5 to 10 etc.
2021-02-18 11:52:30 +10:00
Kris c4ff6def8e
UX: change emailLogin to info class when empty (#12105) 2021-02-17 16:28:52 -05:00
Penar Musaraj 4739bdac0a
UX: Adjustments to admin theme editor (#12112) 2021-02-17 13:00:34 -05:00
Arpit Jalan a174c8b8d4
FIX: hide sso payload behind a button click and log views (#12110) 2021-02-17 21:27:51 +05:30
Penar Musaraj 431c6de480
UX: Add editing guidance for remote themes (#12111) 2021-02-17 10:24:34 -05:00
Joffrey JAFFEUX 237d172fd9
DEV: flexify post-controls and stop relying on clearfix (#12098) 2021-02-17 09:58:17 +01:00
Kris 933dde9419
A11Y: Add rowheader to topic title TDs (#12092) 2021-02-17 00:00:34 -05:00
Kris 355b8f69af
UX: Fix excess line breaks in login modal alerts (#12104) 2021-02-16 21:22:49 -05:00
Arpit Jalan 94036a6f49
FIX: force refresh staff action logs when transitioning from site settings (#12096) 2021-02-17 00:18:39 +05:30
Bianca Nenciu d89c5aedbe
FIX: Fix subcategory, tag drops and none values (#11934)
* FIX: Generate correct URLs for category and tag drops

* DEV: Remove unused properties

* FIX: No subcategory and tag filter did not work
2021-02-16 17:54:24 +02:00
Osama Sayegh 277eae97e1
FIX: Use autocomplete=discourse in select-kit to disable autocomplete in Chrome (#12094)
Chrome ignores `autocomplete="off"` on input fields, but as a workaround we can supply a nonsensical value (`discourse` or anything else) to the `autocomplete` attribute and it'll disable autocomplete.

Context: https://meta.discourse.org/t/-/107484/66?u=osama and https://meta.discourse.org/t/-/140884/13?u=osama.
2021-02-16 12:46:46 +03:00
Martin Brennan 0cba1fafe4
DEV: debug: false for service workers to stop log spam via workbox (#12093) 2021-02-16 14:01:19 +10:00
Martin Brennan 9f0f801ae3
FIX: Do not mark group_flair images as secure on upload (#12081)
See https://meta.discourse.org/t/secure-media-uploads-breaks-group-flair-image/173671/4

Group flair image uploads definitely do not need to be secure.
2021-02-16 12:34:03 +10:00
Martin Brennan c0c7c237aa
FIX: Clean up topic-timer-info CSS classes, add edit button, and improve UI (#12080)
This PR adds an edit button to the topic timer info message which opens the modal.

Also, I have cleaned up a few more places where we were referencing "topic status update" which is what these were called prior to being called topic timers.

The category settings for auto-close topic hours has now also been modified to use the new relative-time-picker component.

Finally, the relative-time-picker input step and min is dynamic based on mins/other intervals selected, see https://review.discourse.org/t/feature-relative-time-input-for-timers-and-bookmarks-and-promote-auto-close-after-last-post-timer-12063/19204/7?u=martin
2021-02-16 12:07:30 +10:00
Joffrey JAFFEUX 323a5f22e7
A11Y: makes select-kit header a listbox (#12078)
Note that for now pressing enter doesn’t make anything, this is awaiting another change.
2021-02-15 18:22:10 +01:00
Arpit Jalan 85c4e8fd32
FEATURE: support `mark` tag (#12088)
This commit adds support for `mark` tag for highlighting text content.
2021-02-15 21:47:30 +05:30
Joffrey JAFFEUX c5d0a33cc5
A11Y: adds support for aria-current through d-navigation-item (#12079) 2021-02-15 15:34:25 +01:00
Gerhard Schlager f71ff2c34b
UX: relative-time-picker should use pluralized strings (#12086) 2021-02-15 14:15:22 +01:00
Joffrey JAFFEUX 467b075ef7
A11Y: makes aria-owns an ID and not a data attribute (#12075) 2021-02-15 12:32:09 +01:00
Joffrey JAFFEUX 71e9c2e50b
A11Y: sets has-popup as menu for select-kit components (#12074) 2021-02-15 12:31:51 +01:00
Joffrey JAFFEUX 79d7c4a3c2
A11Y: makes quote controls accessible (#12073) 2021-02-15 12:31:35 +01:00
David Taylor d8705ee0ad
UX: Fix local-dates styling (#12085)
Renames the new `relative-time` component to `relative-time-picker` to
avoid CSS class conflict with local-dates.
2021-02-15 10:44:30 +00:00
Arpit Jalan c256b94ae0
UX: when auto-selecting topic make sure the focus is on selected topic (#12083) 2021-02-15 16:12:45 +05:30
Martin Brennan 84c7b2c404
FEATURE: Relative time input for timers and bookmarks and promote auto-close after last post timer (#12063)
This PR adds a new relative-time component, that is an input box with a SK dropdown of minutes, hours, days, and months which outputs the duration selected in minutes. This new component is used in the time shortcuts list (used by bookmarks and topic timers) as a new Relative Time shortcut.

Also in this PR, I have made the "Auto-Close After Last Post" timer into a top level timer type in the UI, and removed the "based on last post" custom time shortcut.
2021-02-15 12:49:57 +10:00
Krzysztof Kotlarek ad3ec5809f
FIX: Dismiss new with better migration (#12062)
Original PR was reverted because of broken migration https://github.com/discourse/discourse/pull/12058

I fixed it by adding this line
```
          AND topics.id IN(SELECT id FROM topics ORDER BY created_at DESC LIMIT :max_new_topics)
```

This time it is left joining a limited amount of topics. I tested it on few databases and it worked quite smooth
2021-02-15 08:50:33 +11:00
Jordan Vidrine 7fe5368718
UX: Second Factor + Alert Display (#12071)
* UX: Second Factor + Alert Display

This commit removes JS edits of the modal-alert and uses CSS instead. This commit also adds some styling to the 2FA login when using a key instead of a 2FA authenticator.
2021-02-12 16:24:13 -06:00
Arpit Jalan 46e7d303b1
FEATURE: when moving posts to existing topic auto-select single topic (#12064) 2021-02-12 23:11:20 +05:30
Neil Lalonde cc0d2b623f UX: show plugin descriptions on admin plugins page 2021-02-12 11:38:50 -05:00
David Taylor ae64490162
FIX: Allow all tags in site/theme settings, ignore tag group restrictions (#12067) 2021-02-12 14:59:21 +00:00
Vinoth Kannan 834388dbe0
UX: trim `@` char from start of the username string in search. (#12060)
Currently, we're unable to search users by their username with the `@` symbol in "Posted by" filter on advanced search page.
2021-02-12 19:38:13 +05:30
Osama Sayegh 293fd1f743
DEV: Deprecate {{user-selector}} and replace it with {{email-group-user-chooser}} (#12042)
`{{user-selector}}` is now deprecated and it will be removed from core in Discourse 2.8. All instances of `{{user-selector}}` has been replaced with `{{email-group-user-chooser}}`.
2021-02-12 13:51:36 +03:00
Martin Brennan ff1ac57feb
FIX: Validate duration minutes values for topic timer (#12040)
Add server and client side validations to ensure topic timer durations cannot exceed 2 years and cannot be less than or equal to 0.
2021-02-12 09:05:14 +10:00
Krzysztof Kotlarek a696cc07d2
Revert "FEATURE: Ability to dismiss all new topics (#12018)" (#12058)
This reverts commits 7426764af4 and f5b18e2a31
2021-02-12 08:50:25 +11:00
Blake Erickson 395a903cf6
DEV: Show warning message when using ember css selectors (#12036)
* DEV: Show warning message when using ember css selectors

When editing the theme css via the admin UI a warning message
will be displayed if it detects that the `#emberXXX` or `.ember-view`
css selectors are being used. These are dynamic selectors that ember
generates, but they can change so they should not be used.

* Update error message text to be more helpful

* Display a warning instead of erroring out

This allows the theme to still be saved, but a warning is displayed.

Updated the tests to check for the error message.

Updated the pre tags css so that it wraps for long messages.
2021-02-11 13:48:57 -07:00
Jordan Vidrine 80bcebb71f
UI: Specify social button styling (#12054)
This commit adds more specificity to the social buttons styling.
2021-02-11 14:32:33 -06:00
Kris fcf674f106
UX: Prevent badges on usercards from overflowing (#12037) 2021-02-11 13:41:58 -05:00
Kris 04d0bf9c4a
UX: Improve tag and assign display in search (#12039) 2021-02-11 13:41:43 -05:00
Kris eec093918f
FIX: adjust width to avoid horizontal overflow (#12038) 2021-02-11 13:41:34 -05:00
Penar Musaraj 578f753a13
UX: Adjust focus styles for autocomplete input (#12051) 2021-02-11 13:11:21 -05:00
Robin Ward 2068780493
FIX: When adding a quote when the composer is closed, add a newline (#12049)
Normally we look at where the cursor is, but when the composer is closed
we don't have a cursor and just append at the end. This fix adds a new
line to make sure quotes will always work when inserted when the
composer is closed.
2021-02-11 12:45:20 -05:00
Arpit Jalan 12b57c0dee
FEATURE: Add "Recently read topics" tab to user activity page (#12047) 2021-02-11 22:36:50 +05:30
David Taylor 49affb0542
UX: Hide external login column when account creation in progress (#12048) 2021-02-11 16:26:29 +00:00
Jordan Vidrine 5e1c8111d3
UI: Adjust gradient, icon hover, capitalizations (#12045)
This commit adjusts the scroll gradient on the login modal, changes `email / username` to `Email / Username` and adjusts the color of social button icons on hover in the login modal.
2021-02-11 10:08:01 -06:00
David Taylor 830797a9c3
FEATURE: Allow post/topic thumbnails to be prioritized via markdown (#12044)
Previously we would always take the first image in a post to use as the
thumbnail. On media-heavy sites, users may want to manually select a
specific image as the topic thumbnail. This commit allows this to be
done via a `|thumbnail` attribute in markdown.

For example, in this case, bbb would be chosen as the thumbnail:

```
![alttext|100x100](upload://aaa)
![alttext|100x100|thumbnail](upload://bbb)
```
2021-02-11 15:44:41 +00:00
Penar Musaraj a6bb7e6d25
DEV: Live reload styles in Ember CLI (#12043) 2021-02-11 10:36:34 -05:00
Krzysztof Kotlarek f5b18e2a31
FEATURE: Ability to dismiss all new topics (#12018)
Follow up https://github.com/discourse/discourse/pull/11968

Dismiss all new topics using the same DismissTopicService. In addition, MessageBus receives exact topic ids which should be marked as `seen`.
2021-02-11 13:35:09 +11:00
Jordan Vidrine 47574e5985
FIX: Login UI Fixes (#12034)
This commit adjusts the height of the left side of the login modal, and changes the scroll gradient positioning.
2021-02-10 20:32:44 -05:00
Penar Musaraj f188091a55
UX: Remove Convert option for system themes (#12033) 2021-02-10 19:20:13 -05:00
Jordan Vidrine 4580595bd8
Login signup zazz (#11957)
This PR re-styles the login and create account modals.
2021-02-10 14:53:18 -06:00
Mark VanLandingham 50c3cc7d75
DEV: Trigger appEvent when topic progress component moves (#12030) 2021-02-10 14:07:10 -06:00
Penar Musaraj 544a4e4b48
UX: Changes to new features section in admin dashboard (#12029) 2021-02-10 13:12:04 -05:00
Penar Musaraj f2de7842bb
FEATURE: Support keyboard back/forward navigation on DiscourseHub (#12028) 2021-02-10 11:25:32 -05:00
Kris fcdf7ef019
UX: Remove 2px border from some select-kit buttons (#12016) 2021-02-09 16:35:10 +11:00
Ahmed Gagan 45403e57b6
DEV: Plugin-outlet for adding new item in user-notifications filter navigation bar (#12000) 2021-02-09 16:34:09 +11:00
Krzysztof Kotlarek 354ec6694a
FEATURE: Ability to dismiss new topics in a specific tag (#11968)
* FEATURE: Ability to dismiss new topics in a specific tag

Follow up of https://github.com/discourse/discourse/pull/11927

Using the same mechanism to disable new topics in a tag.

* FIX: respect when category and tag is selected
2021-02-09 10:39:30 +11:00
Jarek Radosz 3e1a293554
DEV: Don't skip tests that run fine in legacy env (#12011)
We didn't run some of the plugin tests since #11899. I'd file that under "whoops".
2021-02-08 18:41:32 +01:00
Rafael dos Santos Silva ceab1c9fdf
FEATURE: Handle user agent push subscription change events (#11994)
A user browser may rotate a user subscription endpoint/keys
anytime.

Currently, Discourse will receive a 4XX response while trying to
deliver a push notification and silently unsubscribe the device.

With this change, we will gracefully handle desativating the old
subscription and the replacement creation with the need for the user
to resubscribe manually every time it breaks.

https://meta.discourse.org/t/-/125179?u=falco
2021-02-08 12:09:52 -03:00
Joffrey JAFFEUX 6d31ead050
A11Y: correctly sets a name on combo-boxes for single selects (#12009) 2021-02-08 11:24:42 +01:00
Joffrey JAFFEUX 898772787c
DEV: makes aria-expanded boolean check strict (#12008)
{{d-button ariaExpanded=xxx}} only accepts Boolean now.
2021-02-08 11:18:39 +01:00
David Taylor 821bb1e8cb
FEATURE: Rename 'Discourse SSO' to DiscourseConnect (#11978)
The 'Discourse SSO' protocol is being rebranded to DiscourseConnect. This should help to reduce confusion when 'SSO' is used in the generic sense.

This commit aims to:
- Rename `sso_` site settings. DiscourseConnect specific ones are prefixed `discourse_connect_`. Generic settings are prefixed `auth_`
- Add (server-side-only) backwards compatibility for the old setting names, with deprecation notices
- Copy `site_settings` database records to the new names
- Rename relevant translation keys
- Update relevant translations

This commit does **not** aim to:
- Rename any Ruby classes or methods. This might be done in a future commit
- Change any URLs. This would break existing integrations
- Make any changes to the protocol. This would break existing integrations
- Change any functionality. Further normalization across DiscourseConnect and other auth methods will be done separately

The risks are:
- There is no backwards compatibility for site settings on the client-side. Accessing auth-related site settings in Javascript is fairly rare, and an error on the client side would not be security-critical.
- If a plugin is monkey-patching parts of the auth process, changes to locale keys could cause broken error messages. This should also be unlikely. The old site setting names remain functional, so security-related overrides will remain working.

A follow-up commit will be made with a post-deploy migration to delete the old `site_settings` rows.
2021-02-08 10:04:33 +00:00
Joffrey JAFFEUX 205db66864
A11Y: Adds support for aria-expanded and aria-controls to btn (#11846)
This commit also uses this new feature for the expand/collapse control of the user activity page.
2021-02-08 08:45:37 +01:00
Joffrey JAFFEUX 8957e4d9d0
A11Y: makes user notifications list more accessible (#11992)
Previous markup used to be

```
<div>
  <div>
    <li>
```

Instead we will now have:

```
<ul>
  <li>
    <div>
```

Note this commit also adds two things:
- ability to override tagName of a widget when attaching it
- ability to pass opts and otherOpts to {{attach}}, it could be useful in templates but is mostly useful to test `tagName` for now
2021-02-08 08:45:14 +01:00
Osama Sayegh dbb015f03e
FIX: Topic progress bar should be on the left in RTL layouts (#11999) 2021-02-08 17:42:55 +11:00