Commit Graph

13495 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Kris fcf674f106
UX: Prevent badges on usercards from overflowing (#12037) 2021-02-11 13:41:58 -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
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
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