Commit Graph

13877 Commits

Author SHA1 Message Date
Bianca Nenciu
5bff65aa69
FIX: Do not show invalid option in flair chooser (#13725)
Both of the commits in this PR are meant to fix the problem of invalid
option being shown in the flair chooser. An invalid option can be shown
if at some point it was a valid one - a group with a flair that was
later changed by an admin and flair was removed. The other option an
invalid option can be selected is if the user had a primary group when
the migration ran and copied the same value to the flair_group_id
column.

* FIX: Set flair_group_id only if group has flair

Follow up to 4ba93aac66.

* FIX: Do not show invalid option in flair chooser

If selected flair group became unavailable because the flair was removed
then the option would still be selected and visible as an ID only.
2021-07-13 19:22:39 +03:00
Mark VanLandingham
5ea98b4df3
DEV: App event when modal is closed (#13722) 2021-07-13 09:57:10 -05:00
Guhyoun Nam
0dc96ce817
FEATURE: Setting to allow moderators to change post ownership (#13708) 2021-07-13 09:40:11 -05:00
Bianca Nenciu
21cf1b78da
FIX: Various translation string fixes (#13715)
Make small action post description a correct sentence. Replace true and
false in site settings description with enabled and disabled.
2021-07-13 12:52:13 +03:00
Martin Brennan
7911124d3d
FEATURE: Uppy image uploader with UppyUploadMixin (#13656)
This PR adds the first use of Uppy in our codebase, hidden behind a enable_experimental_image_uploader site setting. When the setting is enabled only the user card background uploader will use the new uppy-image-uploader component added in this PR.

I've introduced an UppyUpload mixin that has feature parity with the existing Upload mixin, and improves it slightly to deal with multiple/single file distinctions and validations better. For now, this just supports the XHRUpload plugin for uppy, which keeps our existing POST to /uploads.json.
2021-07-13 12:22:00 +10:00
Kris
e2d04a8592
UX: Improve share modal consistency (#13689) 2021-07-12 20:55:59 -04:00
Roman Rizzi
024911cfc4
UX: Move the skip auth confirmation spinner inside the modal body. (#13710) 2021-07-12 20:21:57 -03:00
Jeff Wong
d87a0216bb
FEATURE: Penalty history improvements (#13359)
* FEATURE: add penalty history when silencing a user

Display penalty history (last 6 months) when silencing/suspending a user

* FEATURE: allow default penalty values to be chosen

Adds a site setting that designates default penalty values in hours.

Silence/suspend modals will auto-fill in the default values, but otherwise
will still allow moderators to pick and overwrite values as normal.

First silence/suspend: first value
Second silence/suspend: second value
etc.

Penalty counts are forgiven at the same rate as tl3 promotion requirements do.

Co-authored-by: jjaffeux <j.jaffeux@gmail.com>
2021-07-12 11:36:56 -07:00
Kris
729a9856f8
UX: Add copy button to theme public key (#13690) 2021-07-12 14:34:08 -04:00
Bianca Nenciu
2f5e63fd7f
FIX: Use created_at if last_posted_at is null (#13668)
Topic timeline showed Jan 1970 as last posted time if all posts of a
topic were deleted or whispers.
2021-07-12 19:35:40 +03:00
Andrei Prigorshnev
d9eb37be70
UX: improve the link to the preferences page on the new and unread tabs (#13701)
When the New tab and the Unread tab are empty we show educational messages with links to the preferences page. Both links lead to preferences/account page. In fact, settings that changes behaviour of the New and the Unread tab are on the preferences/notifications page. This PR makes links lead there.
2021-07-12 16:52:23 +04:00
Jarek Radosz
efac01d259
FIX: Scroll to top on badge pages (#13694)
…so we don't end up at a random point on the page after a transition.
2021-07-12 10:48:23 +10:00
Kris
aebc6164fc
UX: Add success state to copy button (#13691)
Replaces the message "Topic link copied" with a more intuitive delayed change of the copy button to a success tick.
2021-07-12 10:47:24 +10:00
Dan Ungureanu
2d904ade6d
FIX: Let staged users choose their username (#13678)
When a staged user tried to redeem an invite, a different username was
suggested and manually typing the staged username failed because the
username was not available.
2021-07-12 07:57:38 +10:00
Penar Musaraj
c7cdebd931
FIX: Switch logos live when changing color schemes in user prefs (#13684) 2021-07-09 14:07:00 -04:00
David Taylor
e1175f9f35
DEV: Add users-directory-controls outlet (#13679)
This can be used by themes/plugins to add additional buttons to the user directory controls
2021-07-09 11:49:34 +01:00
Roman Rizzi
ba62ecac68
FIX: can_admin_group should be true when creating a new group. (#13671)
It looks like this regressed in #10432.

A user can create a group if they're an admin or if they're a mod and the "moderators_manage_categories_and_groups" setting is enabled, so it's safe to always set "can_admin_group" to true for new groups.

It will let us configure automatic membership, default title, and effects on create.
2021-07-09 12:15:00 +08:00
Bianca Nenciu
87c1e98571
FEATURE: Let users select flair (#13587)
User flair was given by user's primary group. This PR separates the
two, adds a new field to the user model for flair group ID and users
can select their flair from user preferences now.
2021-07-08 10:46:21 +03:00
David Taylor
2a1abe9ff0
DEV: Expire cn cookie at end of session (#13659)
This cookie is used to transmit notification read state to the server. It is always cleared by the server on the next page load, so there is no need for the expiry to be so long. This commit updates it to expire at the end of the session (the default), and replaces raw `document.cookie` usage with our `cookie` library.
2021-07-07 11:44:26 +01:00
Alan Guo Xiang Tan
f57d49ed01
UX: Layout issues with topic last visit line. (#13655)
Remove the calculation of width and instead switch to small action class
that automatically sets the width based on the screen size.
2021-07-07 12:40:40 +08:00
Martin Brennan
35f6441938
DEV: Add uppy.js to build and project (#13645)
This PR adds uppy to the project with a custom JS build and the shims needed to import it into our JS code. We need a custom build of Uppy because we do not use webpack for our JS modules/build. The only way to get what you want from Uppy is to use the webpack modules or to include the entire Uppy project including all plugins in a single JS file. This way we can just use the plugins we actually want. Future PRs will actually use Uppy!
2021-07-07 10:39:33 +10:00
Penar Musaraj
95b5794331
DEV: Compile core and plugin stylesheets independently of themes (#13638)
Take 2 of https://github.com/discourse/discourse/pull/13466. 

Fixes a few issues with the original PR: 

- color definition stylesheet target now includes the theme id, to avoid themes set to use the default color scheme loading the same stylesheet 
- changes the internal cache key for color definition stylesheet to reset the pre-existing cache
2021-07-06 13:11:10 -04:00
Dan Ungureanu
da03a3f5d6
FIX: Maintain order when updating notifications (#13643)
A more complex algorithm was used to achieve consensus between server
and client lists of notifications. This commit uses a different and
more simple approach that ignores order, but updates read status of
existing notifications and removes stale notifications.
2021-07-06 13:33:56 +03:00
Vinoth Kannan
33eae4cbd8
FEATURE: add period filter in top topics route for tags. (#13415)
And also move all the "top topics by period" routes to query string param.

/top/monthly => /top?period=monthly
/c/:slug/:id/l/top/monthly => /c/:slug/:id/l/top?period=monthly
/tag/:slug/l/top/daily => /tag/:slug/l/top?period=daily (new)
2021-07-06 15:25:11 +05:30
Dan Ungureanu
34387c5a38
FEATURE: Warn if invited user cannot see topic (#13548)
Users can invite people to topics from secured category, but they will
not be redirected to the topic after signing up unless they have the
permissions to view the topic. This commit shows a warning when invite
is saved if the topic is in a secured category and none of the invite
groups are allowed to see it.
2021-07-06 12:49:26 +03:00
jbrw
cf63931b9e
UX: Remove background image after image has loaded (#13642)
* UX: Remove background image after image has loaded

If an image has a `smallUpload`, that may be set as the `background-image` on the `img` element, and the `img` element set to use `lazy` loading. When the browser decides to load the `src` of the image element, it is rendered on top of the existing background image.

However, if the image proper has a transparent background, the background image may be partially visible through the transparent portions of the image.

This change creates an `onload` event that removes the background image when the image proper has completed loading.
2021-07-05 19:15:29 -04:00
Penar Musaraj
48f36d43eb
DEV: Remove duplicate filterable option in tag-drop (#13640)
Has no effect and raises a console deprecation warning.
2021-07-05 14:42:17 -04:00
Alan Guo Xiang Tan
37b8ce79c9
FEATURE: Add last visit indication to topic view page. (#13471)
This PR also removes grey old unread bubble from the topic badges by
dropping `TopicUser#highest_seen_post_number`.
2021-07-05 14:17:31 +08:00
Alan Guo Xiang Tan
43058db3ca
UX: Use topic list bulk select toggle for user messages list. (#13614) 2021-07-05 10:43:58 +08:00
David Taylor
ddaf2f55fd
FIX: Build quote share URL using post number, not post ID (#13622) 2021-07-02 22:50:04 +01:00
Roman Rizzi
7e6a317597
FIX: Load the category when the category_id attr is present. (#13621)
The store won't autoload the reviewable category anymore as we removed that piece of code in #13412. This commit adds it as a computed property.
2021-07-02 18:25:51 -03:00
Mark VanLandingham
894eb66a0d
FIX: Do not reload whole directory table on username input change (#13616) 2021-07-02 09:51:14 -05:00
Jarek Radosz
fdb85b8025
DEV: Add theme-color meta to bootstrap (#13615)
It's rendered in Rails in:

ebcc70a5ba/app/views/layouts/_head.html.erb (L9-L9)
2021-07-02 16:43:10 +02:00
Jarek Radosz
926889e2d4 FIX: Invalid link definition in bootstrap-json 2021-07-02 10:14:10 -04:00
Dan Ungureanu
3db4ed113b
FIX: Show empty search results sets (#13604)
If the server returned an empty result set, the client did not update
the local set and displayed last search results.
2021-07-02 11:00:31 +10:00
Andrei Prigorshnev
1c38b4abf1
FEATURE: pass supported file extensions to the system file picker (#13583) 2021-07-01 17:13:20 +04:00
Jarek Radosz
e4aa02365c
FIX: Set class on color scheme links in bootstrap (#13594)
Exposes to Ember CLI environment the feature provided in the production env by `lib/stylesheet/manager.rb:295`.

Fixes development env compatibility with discourse-color-scheme-toggle.
2021-07-01 10:58:26 +02:00
Martin Brennan
eb898e5523
FIX: Reorder and hide topic timer options (#13597)
This PR changes the order of the topic timer options
into a more logical order when the topic is open/closed.

Also, we are now hiding the "Schedule Publishing" option
if the topic is not a private message or in a private category.
It does not make sense to schedule publishing to a different
category for a public topic.
2021-07-01 13:18:38 +10:00
Martin Brennan
d2e867ae09
DEV: Try fix keyboard shortcut acceptance tests (#13576)
Page was not scrolled to top so buttons were not in
viewport, so they were being hidden.
2021-07-01 12:25:26 +10:00
Rafael dos Santos Silva
fae68455b7
FIX: Detect decode failures earlier in image optimization pipeline (#13595)
* FIX: Detect decode failures earlier in image optimization pipeline

Follow up to 9b51b9b but also detects the bug earlier and backs off.

What iOS 15 is doing is returning all zeroes to `ctx.getImageData`,
so we don't have to wait until resize to detect the problem.

* Update app/assets/javascripts/discourse/app/lib/media-optimization-utils.js

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

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-06-30 19:03:34 -03:00
Dan Ungureanu
6ba28cbed7
FIX: Reintroduce add group user by email (#13581)
This feature was removed when the modal for adding and inviting members
was split in two modals.
2021-06-30 17:59:22 +03:00
Penar Musaraj
128fdf9d9c
DEV: Revert stylesheet refactors (#13584)
* Revert "FIX: Clear appropriate cache when updating font settings (#13582)"

This reverts commit de6cc7a924.

* Revert "DEV: Improve output of `Stylesheet::Mananger.precompile_theme_css`."

This reverts commit 95038856c9.

* Revert "FIX: Child themes being precompiled multiple times."

This reverts commit 6986b36985.

* Revert "Update spec/components/stylesheet/manager_spec.rb"

This reverts commit ddaa7cc7ea.

* Revert "Refactor scss live refreshing"

This reverts commit a838293aaf.

* Revert "Precompile core stylesheets independently of themes"

This reverts commit 99d259d39b.

* Revert "DEV: Add simple digest for core stylesheets"

This reverts commit d82c58e6cc.
2021-06-30 21:33:15 +08:00
Andrei Prigorshnev
a2e0da16a7
FEATURE: use native file picker in composer (#13552)
We want to remove completely our custom modal for uploading files in composer and directly trigger the system file picker.

This PR makes it happen. The fix is pretty simple since we already weren't using our custom modal on mobile. We just need to start using the same hidden <input type="file"> that we already use on mobile.

It seems to be pretty tricky to test opening a system modal so I haven't added new tests. We already have other tests for file uploading though. We directly trigger jquery-File-Upload plugin hooks in those tests - 3dda926cb2/app/assets/javascripts/discourse/tests/acceptance/composer-attachment-test.js (L89).
2021-06-30 12:45:47 +04:00
Krzysztof Kotlarek
5c43f9a3a3
FIX: problem when [] custom field is send (#13573)
Multiselect data can be saved but when all are removed then data are not cleared

Ajax function is removing an empty array from request data. In that case, we should change `[]` to `null`.

We need that empty values to properly empty data.
2021-06-30 16:18:37 +10:00
Penar Musaraj
a838293aaf Refactor scss live refreshing 2021-06-30 13:42:40 +08:00
Bianca Nenciu
e123476329
FIX: Always render topic counts (#13563)
A post is rendered multiple times when it is being loaded. Sometimes,
not all information is available and the best link in the Onebox cannot
be found.
2021-06-30 15:30:16 +10:00
Joffrey JAFFEUX
33464cb07e
FIX: ensures we don't apply charts options to other modes (#13570)
This reverts commit 1f74ea0f08.
2021-06-29 21:58:35 +02:00
Robin Ward
1f74ea0f08 FIX: Some admin reports (notably backups) were not showing up 2021-06-29 15:14:16 -04:00
Mark VanLandingham
e870c09438
FIX: Do not call 'set' in destroyed directory table component (#13567) 2021-06-29 13:59:32 -05:00
Jarek Radosz
aa56e2a758
DEV: Don't use the Ember global (#13535) 2021-06-29 19:54:18 +02:00