Commit Graph

23579 Commits

Author SHA1 Message Date
Guo Xiang Tan 9b75d95fc6 PERF: Keep track of first unread PM and first unread group PM for user.
This optimization helps to filter away topics so that the joins on
related tables when querying for unread messages is not expensive.
2020-09-09 14:05:41 +08:00
Robin Ward 4dd07843c6 FIX: We have changed the way `__widget_helpers` are resolved 2020-09-08 12:10:59 -04:00
Joffrey JAFFEUX 8413d27cf2
FIX: handles different cases of canInvite/canRemove states in PM (#10607) 2020-09-08 16:35:59 +02:00
dependabot[bot] d21119ee4f Build(deps): Bump lodash in /app/assets/javascripts/pretty-text
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.20.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.20)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-08 10:25:45 -04:00
dependabot[bot] 00e2339e82 Build(deps): Bump lodash in /app/assets/javascripts/discourse-common
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.20.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.20)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-08 10:25:31 -04:00
Joffrey JAFFEUX 02495510e8
FIX: workaround constructor name not available after transpilation (#10623)
This is only reproducible en production build. In this case, constructor.name could be any value like "i" for example.
2020-09-08 10:14:41 +02:00
Guo Xiang Tan b0f22f2523
SECURITY: Remove indication that a group exists if user can't see it.
Minor security fix but we should not leak any hints that a group exists
even if a user does not have access to the group.
2020-09-08 10:53:48 +08:00
Guo Xiang Tan 5ed84d9885
SECURITY: Don't allow moderators to list PMs of all groups.
* Also return 404 when a user is trying to list PMs of a group that
cannot be accessed by the user.
2020-09-08 10:37:00 +08:00
Joffrey JAFFEUX 0b8e7d88fe
FIX: wraps popper call in afterRender and uses createPopper (#10621)
Before this fix, popper was sometimes not applied.
2020-09-07 13:33:52 +02:00
dependabot[bot] 27751ca69f
Build(deps): Bump websocket-extensions (#10617)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-07 12:02:38 +02:00
dependabot[bot] b191ea4f59
Build(deps): Bump websocket-extensions (#10615)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-07 12:02:27 +02:00
dependabot[bot] 2cb0f013cc
Build(deps): Bump elliptic in /app/assets/javascripts/pretty-text (#10611)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-07 12:02:09 +02:00
dependabot[bot] 6bff8636e2
Build(deps): Bump elliptic in /app/assets/javascripts/discourse-common (#10612)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-07 12:01:37 +02:00
dependabot[bot] 9b187b7e11
Build(deps): Bump http-proxy in /app/assets/javascripts/discourse-common (#10613)
Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/http-party/node-http-proxy/compare/1.18.0...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-07 12:00:25 +02:00
dependabot[bot] c119c07fa4
Build(deps): Bump http-proxy in /app/assets/javascripts/pretty-text (#10614)
Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/http-party/node-http-proxy/compare/1.18.0...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-07 12:00:10 +02:00
awesomerobot 13c9d7e704 UX: Add missing labels to mobile composer buttons 2020-09-04 22:18:29 -04:00
Robin Ward da918ac43e FIX: Allow us to call `script_asset_url` in controllers
Without this patch fingerprinting was not applied in production.
2020-09-04 15:23:01 -04:00
Robin Ward 0f9a58e06f FEATURE: Add stylesheets to bootstrap.json endpoint
This allows API consumers (such as Ember CLI) to dynamically get a list
of styles to embed.
2020-09-04 14:12:49 -04:00
Joffrey JAFFEUX c5b8a47901
FIX: ensures we don't attempt to concat an empty list (#10600) 2020-09-04 19:08:07 +02:00
Bianca Nenciu d4471e0316
FIX: Preload bold fonts in wizard
The bold fonts are used in previews for topic title.
2020-09-04 19:23:46 +03:00
Joffrey JAFFEUX ed05839dfc
FIX: prevents error when opening a composer from a tag page (#10596) 2020-09-04 15:47:22 +02:00
Bianca Nenciu 58b97ace23
DEV: Use a special import to declare font faces (#10583)
Update discourse-fonts to v0.0.3.

Follow-up to 7b7357147e.
2020-09-04 16:25:50 +03:00
Joffrey JAFFEUX 52672b9eab
DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
awesomerobot e4ebc303bb FEATURE: Add below-static plugin outlet 2020-09-03 22:58:58 -04:00
Vinoth Kannan ea423b471a FIX: make crawler linkback list compatible with google schema guidelines. 2020-09-04 04:35:32 +05:30
Robin Ward 8c0f18794e FEATURE: Deprecate lodash so we can remove it.
It's currently 240k of Javascript we don't need anymore. It's been
replaced by ES6 and a couple helper functions.
2020-09-03 10:03:33 -04:00
Robin Ward 3a46e44ed8 Rename `merge` to `deepMerge` so it's more clear what it's doing 2020-09-03 10:03:33 -04:00
Robin Ward f365d4639a REFACTOR: Remove `_.isEqual` 2020-09-03 10:03:33 -04:00
Robin Ward c4079780be REFACTOR: Remove `_.merge` 2020-09-03 10:03:33 -04:00
Robin Ward 720cd57fb5 FIX: Convert jQuery array to JS array 2020-09-03 10:03:33 -04:00
Robin Ward 5e5d5b4f35 REFACTOR: Remove `_.last` 2020-09-03 10:03:33 -04:00
Robin Ward 0da953b40e REFACTOR: Remove `_.compact` 2020-09-03 10:03:33 -04:00
Robin Ward c2cfa62000 REFACTOR: Remove `_.intersection` 2020-09-03 10:03:33 -04:00
Robin Ward 0b098566ff REFACTOR: Remove `_.union` 2020-09-03 10:03:33 -04:00
Robin Ward e60d06d880 REFACTOR: Remove `_.isString` 2020-09-03 10:03:33 -04:00
Robin Ward b4444070b3 REFACTOR: Remove `_.groupBy` 2020-09-03 10:03:33 -04:00
Robin Ward 1265a5f7c0 REFACTOR: Remove `_.max` 2020-09-03 10:03:33 -04:00
Robin Ward d06deb0c4f REFACTOR: Remove `_.chain` 2020-09-03 10:03:33 -04:00
Robin Ward 71ddcefffa REFACTOR: Remove `_.filter` 2020-09-03 10:03:33 -04:00
Robin Ward 87b3caf927 REFACTOR: Remove `_.reject` 2020-09-03 10:03:33 -04:00
Robin Ward 2a4dfa83b0 REFACTOR: Remove `_.omit` 2020-09-03 10:03:33 -04:00
Robin Ward 17bca14c4b REFACTOR: Remove `_.sortBy` 2020-09-03 10:03:33 -04:00
Robin Ward 2353794a30 REFACTOR: Remove `_.findIndex` 2020-09-03 10:03:33 -04:00
Robin Ward e3ec7b72d0 REFACTOR: Remove `_.uniq` and use ember version 2020-09-03 10:03:33 -04:00
Robin Ward 66021abe41 REFACTOR: Remove `_.first` from codebase 2020-09-03 10:03:33 -04:00
Robin Ward 55c9c54b8b REFACTOR: Remove `_.range` and use ES6 instead 2020-09-03 10:03:33 -04:00
Robin Ward 115b3b6921 REFACTOR: Remove `_.isEmpty` in favor of the existing version 2020-09-03 10:03:33 -04:00
Robin Ward 65f6a92129 REFACTOR: Replace `_.extend` with `Object.assign` 2020-09-03 10:03:33 -04:00
Robin Ward 2f11457263 REFACTOR: Use `Array.isArray` instead of `_.isArray` 2020-09-03 10:03:33 -04:00
Blake Erickson 67dec38f31 FIX: Gravatar download attempt if user is missing their email
It is possible that a user could exist without an email, if so we should
not enqueue a job to download their gravatar.

This commit resolves this error that can occur:

```
Job exception: undefined method `email' for nil:NilClass
/var/www/discourse/app/models/user.rb:1204:in `email'
/var/www/discourse/app/jobs/regular/update_gravatar.rb:12:in `execute'
```

This commit also fixes the original spec which actually was wrong. The
job never enqueued in the original spec and so the gravatar was never
actually updated and the test was checking if the two values were the
same, but they were both null and never updated, so of course they were
the same!

A new test has also been added to make sure the gravatar job isn't
enqueued when a user's email is missing.
2020-09-02 20:19:46 -06:00
Krzysztof Kotlarek 9954a677ab
FIX: don't send mailing list for post with empty content (#10577)
discourse-assign is creating posts with empty content to show that a specific user was assign/unassigned for a specific topic.

It is causing confusing emails with empty content

The bug was mentioned here: https://meta.discourse.org/t/again-on-empty-emails-and-notifications-generated-on-topic-assignment/162213
2020-09-03 08:58:25 +10:00
Joffrey JAFFEUX de038c0eab
FIX: highlightjs 10 requires some languages to be loaded before others (#10584)
cs is also not present in 10 and relies only on csharp file, but for cs alias to work csharp has to be loaded.
2020-09-02 21:32:57 +02:00
Penar Musaraj 6a837c32e4
DEV: Add class to wizard HTML element 2020-09-02 14:53:38 -04:00
Penar Musaraj 50827684d5
UX: Hide category settings badges checkbox when enable_badges is off 2020-09-02 11:23:59 -04:00
Robin Ward 0a492829ea Add category id to webhook post serializer 2020-09-02 10:42:51 -04:00
Joffrey JAFFEUX c6e336b519
REFACTOR: simplifies connectors code (#10579)
- directly uses factoryFor to avoid having to set owner later
- drops jquery usage
- renames view into component as I find it more explicit
2020-09-02 15:53:42 +02:00
Joe 879e274dc7 UX: wrap extra long links in GitHub oneboxes instead of overflowing 2020-09-02 21:50:57 +08:00
Gerhard Schlager 31c1d57228
FIX: System message wasn't fully translatable 2020-09-02 15:24:25 +02:00
Dan Ungureanu ef68e11137
FIX: Check if invite has expired before showing it (#10581) 2020-09-02 13:24:49 +03:00
Guo Xiang Tan 01600492de
FIX: Don't raise error in update username job if user has been deleted. 2020-09-02 11:17:17 +08:00
awesomerobot ec0b4b2acc FIX: wait for groups before showing empty message 2020-09-01 22:36:00 -04:00
Jeff Wong d49e96c6a3
DEV: add plugin hooks for silence message parameters (#10538)
DEV: add plugin hooks for silence message parameters

Allows plugins to add, and update extra silence message params for custom
i18n vars

Allows plugins to override system messages via `message_title` and
`message_raw` parameters. We can later expose these params where necessary via event
hooks. Expose the parameter for the on user_silenced trigger.
2020-09-01 17:25:24 -07:00
Kane York 26ec4fd25b
FIX: User export category preferences on a deleted category. (#10573)
Tests from a1dd761bd9 were incomplete and did not test a deleted category's category_users record.
2020-09-01 13:22:59 -07:00
Ahmed Gagan b14098ce28
removed REGEXP_IN_MATCH regex to make it flexible to use with plugins (#10476)
* dynamic regex generation for 'STATUS' and 'IN' ddropdown
2020-09-01 14:33:05 +02:00
Arpit Jalan 34478760b2 Update annotations. 2020-09-01 13:41:04 +05:30
Joffrey JAFFEUX f8062300da
DEV: removes jquery usage from highlight-syntax (#10564) 2020-09-01 09:50:49 +02:00
Arpit Jalan bb2e830010 Remove out-of-date / non-core annotations. 2020-09-01 12:40:57 +05:30
Arpit Jalan e66eefe179 Annotate models. 2020-09-01 10:22:32 +05:30
Krzysztof Kotlarek 084e15b447
FIX: modify notification after remove auto_watch_category (#10568)
When a category is removed from `auto_watch_category` we are removing
CategoryUser. However, there are still TopicUser with notification level
set to `watching` which was inherited from Category.

We should move them back to `regular` unless they were modified by a user.
2020-09-01 13:07:41 +10:00
awesomerobot e824385e64 only remove edit button margin when text is hidden 2020-08-31 22:45:43 -04:00
Guo Xiang Tan 069a109cbb
DEV: Require scheduled job in development to avoid loading file twice.
This removes the need to memoize constant in order to avoid the "warning: already initialized constant".
2020-09-01 10:14:40 +08:00
Kane York a1dd761bd9
FIX: Handle deleted categories in post export (#10567)
Fixes a crash when exporting my own archive on Meta.
2020-08-31 17:33:28 -07:00
Martin Brennan 594d919d22
FIX: Focus first button in topic admin menu (#10562)
When using Shift+A to toggle the admin menu for a topic the first button was not focused, so the menu could not be navigated with tab.
2020-09-01 10:29:35 +10:00
Kane York 5ec5fbd7ba
User export improvements 2 (#10560)
* FEATURE: Use predictable filenames inside the user archive export

* FEATURE: Include badges in user archive export

* FEATURE: Add user_visits table to the user archive export
2020-08-31 15:26:51 -07:00
Joe c3560a66f3 DEV: CSS truncation followup
After merging this

58fe78bf28 (diff-fed21847d651f6eb2cc76abbd770f5f8)

I noticed that the code I'm removing in this commit is causing text to be truncated a bit early on desktop. So, I'm removing it for now.
2020-09-01 02:01:17 +08:00
tshenry 2550c5bd03
FIX: Ensure disabling 2FA works as expected (#10485) 2020-08-31 09:56:57 -07:00
Roman Rizzi 2a3a173e8e
FIX: Disable insert link button when editing a category (#10549) 2020-08-31 13:50:40 -03:00
Joe 58fe78bf28 UX: don't wrap topic status icons in the header if there's more than one
Context: https://meta.discourse.org/t/when-a-topic-is-closed-and-pinned-the-pin-icon-in-header-not-in-correct-place/162473

Flex is causing a bit of a problem here since it makes the `topic-statuses` div in the header wrap when it has more than one icon. Given that we already use grid on the parent and that the icons are aligned properly, I think it's safe to remove it here.
2020-09-01 00:40:42 +08:00
Bianca Nenciu f2e14a3946
FEATURE: Add site setting and wizard step to set base font (#10250)
Co-authored-by: Neil Lalonde <neillalonde@gmail.com>
2020-08-31 13:14:09 +03:00
Guo Xiang Tan 5270cd97ef
DEV: Leaking state in `PostActionNotifier` in tests take 2.
Follow-up to a3b48826
2020-08-31 12:55:42 +08:00
Guo Xiang Tan a3b4882665
DEV: Leaking state in `PostActionNotifier` in tests.
Follow-up to 8a0478b97d
2020-08-31 12:04:17 +08:00
Sam Saffron b31da92ede
DEV: clear last seen cache consistently
Previously in some cases the test suite could fail due to a bad entry in
redis from previous tests

This ensures the correct cache is expired when needed

Additionally improves performance of the redis check
2020-08-31 08:54:42 +10:00
Sam Saffron 8ca8a7edba
DEV: Lint file
Ruby in warning mode complains about `foo *[]` instead `foo(*[])` is
preferred
2020-08-31 08:52:01 +10:00
Penar Musaraj b4c5f6631f
FIX: Do not set color_scheme_id in user options when no schemes are marked as selectable 2020-08-30 09:32:40 -04:00
Kris 7bba65b6f5
UX: Restyle user menu so user links are findable (#10554) 2020-08-28 20:20:59 -04:00
Kane York c5dc729e77
FEATURE: Add category tracking state to user archive export (#10557)
Tackling a simple table for the first actual new file in the user archive export.
2020-08-28 13:16:31 -07:00
Robin Ward aae97457d2
REFACTOR: Don't use `layoutName` in select-kit (#10556)
Instead import the templates as modules, the way Ember CLI wants us to.
2020-08-28 15:30:20 -04:00
Kane York 84dba3c1c7
FIX: UserAction did not have a types enum (#10553)
This is important for Data Explorer to provide proper help text.
2020-08-28 11:49:19 -07:00
Kane York 225cdba676 DEV: drop the explicit .each in UserArchive CSV writing
I think this is mostly stylistic, but this helps prevent explosive typos in the enum_for() line.
2020-08-28 11:46:53 -07:00
Kane York 4aed861336 DEV: minor refactors to ExportUserArchive(Spec) 2020-08-28 11:46:53 -07:00
Kane York 7bf199b0c4 DEV: Switch to new ExportUserArchive job
We now use the newly created job class from the previous commit.
2020-08-28 11:46:53 -07:00
Kane York a8560d741f DEV: Create ExportUserArchive as clone of ExportCsvFile
This is in preparation for improvements to the user archive export data.
Some refactors happened along the way, including calling the different _export methods 'components' of the zip file.

Additionally, make the test for post export much more comprehensive.

Copy sources:
  app/jobs/regular/export_csv_file.rb
  spec/jobs/export_csv_file_spec.rb
2020-08-28 11:46:53 -07:00
Penar Musaraj b7cfc9e861
FEATURE: User selectable color schemes (#10544) 2020-08-28 10:36:52 -04:00
Martin Brennan 2352f4bfc7
DEV: Replace SECURE_MEDIA_ROUTE const with other methods (#10545)
This is so if the route changes this const won't be around to bite us, use the Rails route methods instead.
2020-08-28 11:28:11 +10:00
Robin Ward 96edb7da38 REFACTOR: Move Mousetrap library to an import 2020-08-27 16:17:19 -04:00
Robin Ward c172f2068d
REFACTOR: Remove $.cookie in favor of a local library based on it (#10548)
This helps us out in a few ways:

1. It lessens our reliance on jQuery
2. It's slightly less code because it omits options we don't use
3. It is one less library to import and put into ES6 modules
2020-08-27 14:07:51 -04:00
Vinoth Kannan a8502ae1c4
FEATURE: add dismiss unread topics button when filtered by tag. (#10547) 2020-08-27 23:04:45 +05:30
Joffrey JAFFEUX 1cc5e8ea63
DEV: gives didRender and willRerender hooks to widgets (#10496)
didRender will be called each time the widget is rendered
willRerender will be called the second time a widget is rendered to give an opportunity to clean some state before the tree is replaced
2020-08-27 16:07:14 +02:00
David Taylor 89cb537fae
DEV: Switch letter avatar service to new domain (#10546) 2020-08-27 12:05:36 +01:00
Kane York a51db9a7bf
UX: make category topic counts clickable on mobile (#10541) 2020-08-27 01:50:18 -07:00
Guo Xiang Tan a4ec4c06e3
Fix the build. 2020-08-27 13:50:07 +08:00
Guo Xiang Tan 40c6d90df3 PERF: Create a partial regular post_search_data index on large sites.
With the addition of `PostSearchData#private_message`, a partial
index consisting of only search data from regular posts can be created.
The partial index helps to speed up searches on large sites since PG
will not have to do an index scan on the entire search data index which
has shown to be a bottle neck.
2020-08-27 13:42:00 +08:00
Blake Erickson 02833e133c FIX: Suspend API to require `suspend_until` and `reason` params
These fields are required when using the UI and if `suspend_until`
params isn't used the user never is actually suspended so we should
require these fields when suspending a user.
2020-08-26 19:05:48 -06:00
Kris 95179a5ab6 Button bar needs visible overflow, follow-up to 489443e 2020-08-26 20:52:03 -04:00
Kris 489443e3a9
UX: Better handling of long category names and button bar in composer (#10542) 2020-08-26 19:38:20 -04:00
Jordan Vidrine 7cdef9f793
Remove tag name from classList (#10540)
* Remove tag name from classList
2020-08-26 17:20:57 -05:00
Joshua Rosenfeld 1e6d125db6
FIX: Remove additional paths from robots.txt
admin path is protected by guardian and thus inaccessible to crawlers

Follow up to b52143f
2020-08-26 16:52:22 -04:00
Jordan Vidrine ce2491dc2f
Css class additions (#10532)
* Category Page / Tag Class Additions

These additions add:

-the name of the tag as a css class to discourse tags.
-'pinned' as a css class to pinned topics in the category view
2020-08-26 12:21:47 -05:00
Joffrey JAFFEUX f5eccdd0b8
FIX: ensures period-chooser is not losing query params (#10534)
eg repro before:
- visit http://pr-discourse.test/top/weekly?f=foo
- select another period in the period chooser
- f=foo was gone

After this commit it should still be present
2020-08-26 19:01:08 +02:00
Robin Ward ff4de97dfd
REFACTOR: Move `bootbox` to an import instead of global variable (#10533) 2020-08-26 12:57:13 -04:00
Gerhard Schlager 354014099d Update copy and remove unused strings 2020-08-26 18:08:41 +02:00
David Taylor 4351fa435e
FIX: Correctly redirect after external login on subfolder sites (#10529) 2020-08-26 15:52:21 +01:00
jahan-ggn ae7ff5eb73
FEATURE: Added sort by username for directory items (#10482)
* done-sorting-usernames-on-users-page

* sorted-usernames-on-users-page

* spec written

* specs added
2020-08-26 10:14:20 -04:00
Guo Xiang Tan dbfb2a1e11
Minor follow-up bug fix for 5ff6c10. 2020-08-26 17:25:28 +08:00
Guo Xiang Tan 5ff6c10320
FIX: Ensure that topic timers belonging to trashed topics are destroyed. 2020-08-26 16:11:10 +08:00
Guo Xiang Tan 3cc761ac44
FIX: Clean up toggle closed topic timer when user is not authorized. 2020-08-26 12:59:05 +08:00
Guo Xiang Tan 5bca1aec48
FIX: Clean up topic_timers when no longer valid.
This was causing a bug where the jobs for the topic_timers will keep
getting enqueued over and over again.
2020-08-26 12:18:51 +08:00
Guo Xiang Tan 1e8f216e17
FIX: Ensure autoclose based on last post is executed by system user. 2020-08-26 12:08:46 +08:00
Guo Xiang Tan ffc5bb7278
Revert "FIX: Topic Timer auto opening closed topics (#10524)"
This reverts commit 7cfd5f87ff.
2020-08-26 09:32:11 +08:00
Blake Erickson 7cfd5f87ff
FIX: Topic Timer auto opening closed topics (#10524)
This commit is addressing an issue where it is possible that there could
be multiple topic timer jobs running to close a topic or a weird race
condition state causing a topic that was just closed to be re-opened.

By removing the logic from the Topic Timer model into the Topic Timer
controller endpoint we isolate the code that is used for setting an
auto-open or an auto-close timer to just that functionality making the
topic timer background jobs safer if multiple are running.

Possibly in the future if we would like this logic back in the model a
refactor will be needed where we actually pass in the auto-close and
auto-open action instead of mixing it with the close and open
action that is currently being passed to the controller.
2020-08-26 11:17:12 +10:00
Kane York 93e136ae0e
UX: show a generic error on upload for XHR status 0 (#10521)
This indication covers all cases of network errors, not just "cancelled by user".
The post upload component already has its own handling for user-cancelled uploads, but the generic upload component does not.

Tested by stopping my localhost server right before attempting to upload a file.
2020-08-25 12:08:03 -07:00
Penar Musaraj 7277ca6cb6
UX: Add category-title-before to categories-boxes layout
Makes it consistent with the other /categories layouts
2020-08-25 13:35:13 -04:00
fzngagan c363189858 Accounted for the change while reading the fields added specs to confirm working 2020-08-25 09:52:18 -04:00
fzngagan 352ad826c1 FIX: symbols and strings should be treated similarly while saving custom fields 2020-08-25 09:52:18 -04:00
Robin Ward 2523a21fc3 FIX: Server side rendering was broken with new `helperContext()` 2020-08-25 09:16:32 -04:00
Robin Ward a3fb732b23 REFACTOR: We can reuse `getOwner` for some container stuff 2020-08-25 09:16:32 -04:00
Robin Ward 347a4981a0 REFACTOR: Remove `Discourse` constant from `get-owner` 2020-08-25 09:16:32 -04:00
Robin Ward 185ed80702 REFACTOR: Remove `Discourse` constants from nav-item 2020-08-25 09:16:32 -04:00
Robin Ward c068098f75 REFACTOR: Remove container from `User` class 2020-08-25 09:16:32 -04:00
Robin Ward c94ba34882 REFACTOR: Remove `__container__` from Site 2020-08-25 09:16:32 -04:00
Robin Ward ac498ae2a0 REFACTOR: Remove container from ajax 2020-08-25 09:16:32 -04:00
Robin Ward df8ae6891c REFACTOR: Remove constants from `text` helper 2020-08-25 09:16:32 -04:00
Robin Ward 4063cab8c2 REFACTOR: Missed `container`s in `DiscourseURL` 2020-08-25 09:16:32 -04:00
Robin Ward 02e8d84e30 REFACTOR: Remove `Discourse` constant from `showModal` 2020-08-25 09:16:32 -04:00
Robin Ward 98e5e1cd53 REFACTOR: Remove container from `DiscourseURL` 2020-08-25 09:16:32 -04:00
Robin Ward dae8b9bcfb FIX: Remove container from utilities 2020-08-25 09:16:32 -04:00
Robin Ward 89d766d089 REFACTOR: Remove container from safari-hacks 2020-08-25 09:16:32 -04:00
Robin Ward c7c3fd4209 REFACTOR: Remove container from pwa-utils 2020-08-25 09:16:32 -04:00
Robin Ward ebc0298ea0 REFACTOR: Remove `Discourse.authenticationComplete` 2020-08-25 09:16:32 -04:00
Robin Ward 20e1233f89 REFACTOR: Remove container from raw template helper 2020-08-25 09:16:32 -04:00
Gerhard Schlager dac0e5b3cc
Merge pull request #10519 from gschlager/get-url
Fixes for getURL() in subfolders and basePath in translations
2020-08-25 11:42:50 +02:00
Jarek Radosz e66f95de3a
FIX: DEV: Lock-on improvements (#10448)
* DEV: Don't listen for deprecated events

https://developer.mozilla.org/en-US/docs/Web/API/Element/DOMMouseScroll_event

https://developer.mozilla.org/en-US/docs/Web/API/Element/mousewheel_event

* DEV: Listen only on the `body` element

* DEV: clearLock after a while if target is missing

* DEV: Bind the callback

* FIX: Use `requestAnimationFrame`

Prevents content jumps
2020-08-25 11:42:00 +02:00
Gerhard Schlager 6c09fd4289 DEV: Remove unused code and translations 2020-08-25 11:41:19 +02:00
Joe 66aa94c515
UX: Timeline should jump to the bottom of the post in single-post topics (#10503) 2020-08-25 16:22:07 +08:00
Kris a92a6b7b10 UX: Minor layout fixes and improved consistency on theme admin 2020-08-24 22:51:58 -04:00
Mark VanLandingham cef51b3489
DEV: Remove hasBlock from user-info component (#10415) 2020-08-24 21:44:01 -05:00
Guo Xiang Tan 9c997ae117
Revert "DEV: allow plugins to send extra silenced message params"
This reverts commit c3aeb442d7.

Broken specs so helping Jeff to revert first.
2020-08-25 09:57:57 +08:00
Jeff Wong c3aeb442d7 DEV: allow plugins to send extra silenced message params
allows plugins to send extra custom message params so that they can
include things such as silence reason and message_body if desired
2020-08-24 18:34:18 -07:00
Krzysztof Kotlarek 7b6f8517bf
FIX: limit number of users addable to group at once (#10510)
When someone wants to add > 1000 users at once they will hit a timeout.
Therefore, we should introduce limit and inform the user when limit is exceeded.
2020-08-25 08:55:21 +10:00
Neil Lalonde ed30f49315
FIX: duplicate categories and tags allowed in inputs where they shouldn't be allowed
blocklist was renamed to blockedCategories/Tags
2020-08-24 17:37:04 -04:00
Neil Lalonde 52217099ed
FIX: group categories inputs not filled sometimes
If you land on the group > manage > categories page or reload it,
the fields will all be blank when there should be categories.
2020-08-24 17:15:37 -04:00
Gerhard Schlager 1959745c2c FIX: Current title wasn't visible when assigning badge title 2020-08-24 21:39:44 +02:00
Roman Rizzi dd13304b81
FEATURE: More API scopes (#10493) 2020-08-24 12:15:08 -03:00
Joffrey JAFFEUX b6dd3eca9a
FIX: ensures diversity code is not applied multiple times (#10517) 2020-08-24 16:10:47 +02:00
Joffrey JAFFEUX 265d8bc1d7
FIX: close picker on emoji selection when on mobile device (#10516) 2020-08-24 15:04:44 +02:00
Joffrey JAFFEUX c3364b3a6b
UX: improves picker on automatic dark themes (#10515) 2020-08-24 15:04:11 +02:00
Joffrey JAFFEUX 226be994da
REFACTOR: rewrite the emoji-picker (#10464)
The emoji-picker is a specific piece of code as it has very strong performance requirements which are almost not found anywhere else in the app, as a result it was using various hacks to make it work decently even on old browsers.

Following our drop of Internet Explorer, and various new features in Ember and recent browsers we can now take advantage of this to reduce the amount of code needed, this rewrite most importantly does the following:
- use loading="lazy" preventing the full list of emojis to be loaded on opening
- uses InterserctionObserver to find the active section
- limits the use of native event listentes only for hover/click emojis (for performance reason we track click on the whole emoji area and delegate events), everything else is using ember events
- uses popper to position the emoji picker
- no jquery code
2020-08-24 14:20:51 +02:00
David Taylor 9debfed060
FIX: Add cache-busting parameter to ace-editor javascript
Long-term we should consider adding the file hash to javascript URLs, so that the URL changes whenever the file changes
2020-08-24 12:29:46 +01:00
David Taylor ac80109705
DEV: Improve user card styling extensibility (#10508)
- Add a metadata-row class
- Remove wrapper tags from user-card-after-metadata and user-card-before-badges outlets
- Correct max-height for mobile card
2020-08-24 11:02:40 +01:00
Joffrey JAFFEUX 23b823dd3a
FIX: removes us_pacific-new from the list of available timezones (#10514) 2020-08-24 11:04:46 +02:00
Guo Xiang Tan 4b30799054
FIX: Correct `personal_messages:<username>` advanced search filter.
Renamed from `private_messages` to `personal_messages` without
deprecation because the `private_messages` advanced search filter never
worked in the first place when it was implemented.
2020-08-24 11:54:30 +08:00
Martin Brennan 9022e4516f
FIX: Remove unnecessary audio/video parent element load (#10511)
Meta report: https://meta.discourse.org/t/sending-many-requests-for-video-audio-upload-while-editing-post/161487

When typing in the composer we are sending a lot of unnecessary load() requests for the video/audio elements. This line was added months ago before we improved previewing/video thumbnails, which have improved things, so it is no longer required. After removing this line everything still works and no more additional requests are sent.
2020-08-24 13:18:38 +10:00
Vinoth Kannan 62f4fc728d UX: lowercase tag name before checking it with topic title.
Tag names can contain uppercase letters if `force_lowercase_tags` site setting disabled.
2020-08-23 21:09:51 +05:30
Vinoth Kannan 66976baefa DEV: skip using `br` tag in header widget rendering.
562180dd9a
2020-08-22 13:38:37 +05:30
Penar Musaraj 8b2c4b07a4
UX: Tweaks to admin color palette dropdown (#10502) 2020-08-21 09:30:11 -04:00
Krzysztof Kotlarek 7833853cf1
FIX: display warning only if all users already added to the group (#10500)
If at least one user can be added to the group, proceed with that action
2020-08-21 13:38:09 +10:00
Guo Xiang Tan daddad7fd6
DEV: Update annotations. 2020-08-21 11:36:53 +08:00
Guo Xiang Tan d12d8fb7fd
DEV: Include more information when reporting search indexing failures. 2020-08-21 11:02:00 +08:00
Guo Xiang Tan aae9e6e5fd
FIX: `Topic.similar_to` results in error if cooked raw is blank. 2020-08-21 10:54:08 +08:00
Martin Brennan 2aa1482421
FIX: Bookmark list showing wrong no content message (#10501)
Meta report: https://meta.discourse.org/t/spurious-permissions-error-after-deleting-last-bookmark/161289

When deleting all bookmarks in their list, users were seeing an "access denied" message instead of the regular no content message. This is because when we were calling loadMore and no further results were returned, we were presuming the null response from the resolved promise meant that there was a permissions error. Fixed this and moved the message into a computed property to show the correct message.
2020-08-21 11:01:12 +10:00
Kane York ab0b034404
FIX: Wizard could not send custom color schemes to the client correctly (#10484)
This was likely introduced with the refactor to make ColorSchemeColor a database object. Add a test so this doesn't happen again.

Also test other basics of the WizardSerializer.

For some reason, the .as_json left Ruby objects in; I solved this with a round trip through JSON during the test.
2020-08-20 17:10:33 -07:00
Guo Xiang Tan 337f062f0f
PERF: Defer indexing post for search when saving a post.
Indexing a post for search is slow and there is no reason for us to have
to block saving a post due to search indexing.
2020-08-21 07:52:43 +08:00
Penar Musaraj 3c06dd9b99
FIX: Detect dark scheme server-side for better dark logo support (#10490)
* FIX: Use dark logo when dark scheme is default

* Small refactor
2020-08-20 14:23:18 -04:00
Gerhard Schlager 0bd27cd10b Make prettier happy 2020-08-20 16:27:32 +02:00
Gerhard Schlager cff68ef0dd FIX: User titles from translated badge names were automatically revoked
It also cleans up the denormalized data about badge titles in the user_profiles table.
2020-08-20 11:15:53 +02:00
Vinoth Kannan 8348a41124
FEATURE: add `regular_categories` field in site setting & user option. (#10477)
Like "default watching" and "default tracking" categories option now the "regular" categories support is added. It will be useful for sites that are muted by default. The user option will be displayed only if `mute_all_categories_by_default` site setting is enabled.
2020-08-20 00:35:04 +05:30
Neil Lalonde 298ed5d021
FIX: delete unused tags shouldn't delete tags belonging to tag groups 2020-08-19 12:17:49 -04:00
Neil Lalonde 96511e4548
UX: better wording when there are no unused tags to delete 2020-08-19 12:17:48 -04:00
Blake Erickson 367de2594d
FIX: Unlike own posts on ownership transfer (#10446)
* FIX: Unlike own posts on ownership transfer

If a user has liked a post that has passed the
`post_undo_action_window_mins` system setting window and you transfer ownership
of that post to that user you will be the owner of a post that you have
liked, but cannot unlike resulting in a weird UI behavior. This commit
fixes this issue.

The existing tests didn't check for the timeout window for unliking
posts so I added that in.

I couldn't find a good way to do this logic inside of the guardian class
so rather than duplicating behavior of the `PostActionDestroyer` class
inside of the `PostOwnerChanger` I decided to pass in a "bypass"
variable that could be used to check if the calling class is the
'post_owner_changer' and bypass the guardian instead. I went this route
because the guardian `can_delete_post_action` method has no way of
distinguishing how to allow a user to be able to unlike their own posts
after the timeout window but only on a post owner change.

* use an options hash instead
2020-08-19 09:21:02 -06:00
jbrw aa1fc01307
FEATURE - Moderators can create and manage groups (#10432)
Enabling the moderators_manage_categories_and_groups site setting will allow moderator users to create/manage groups.

* show New Group form to moderators

* Allow moderators to update groups and read logs, where appropriate

* Rename site setting from create -> manage

* improved tests

* Migration should rename old log entries

* Log group changes, even if those changes mean you can no longer see the group

* Slight reshuffle

* RouteTo /g if they no longer have permissions to view group
2020-08-19 10:41:40 -04:00
Robin Ward 3640c00b03
Remove `Discourse` constant usage (#10470)
* REFACTOR: Get us closer to no `Discourse` constants in tests

* REFACTOR: Remove `Discourse.currentUser`

* REFACTOR: `prioritizeNameInUx` is really a helper and can use context

* REFACTOR: Rename test

* REFACTOR: Remove `Discourse.MarkdownItURL` and use session

* REFACTOR: Remove unused `LetterAvatarVersion`

* REFACTOR: Remove unused `Discourse.ThemeSettings`

* REFACTOR: Remove unused CDN constants

* REFACTOR: The `globalNotice` property doesn't exist anymore

* REFACTOR: Remove `Discourse.__container__` from plugin api

* REFACTOR: Consider `logout()` a helper and remove container.
2020-08-19 08:51:48 -04:00
Joffrey JAFFEUX dde3d63b33
DEV: adds event_reminder (27) and event_invitation (28) (#10473)
Note that these events are also added to the list of events sent to push notifications.
2020-08-19 12:07:51 +02:00
Joffrey JAFFEUX 3e49c5b4d8
FIX: do not cancel search early in tests (#10445)
This is done to avoid cases where search would be cancelled before debounce.
2020-08-19 09:57:40 +02:00
Penar Musaraj 328ad921fb
FIX: display label when theme uses default color scheme 2020-08-18 21:11:15 -04:00
Penar Musaraj 1a7391a251
FIX: do not override logo markup when loading page in dark mode
Ensures that when loading the page in dark mode, logo can switch back to light logo if user toggles their OS appearance.
2020-08-18 20:33:42 -04:00
Jordan Vidrine ed0e1e28b4
FIX: Fix css var issues + button :active gradient (#10469)
* FIX: Fix css var issues

Adds ability for published page to use css `var()` + import the `var()` definitions
2020-08-18 14:25:38 -05:00
Roman Rizzi 390615fbcd
UX: Help users understand the meaning of each scope. (#10468) 2020-08-18 15:12:04 -03:00
Penar Musaraj 882b0aac19
DEV: Let themes extend color definitions (#10429)
Themes can now declare custom colors that get compiled in core's color definitions stylesheet, thus allowing themes to better support dark/light color schemes. 

For example, if you need your theme to use tertiary for an element in a light color scheme and quaternary in a dark scheme, you can add the following SCSS to your theme's `color_definitions.scss` file: 

```
:root {
  --mytheme-tertiary-or-quaternary: #{dark-light-choose($tertiary, $quaternary)};
}
```

And then use the `--mytheme-tertiary-or-quaternary` variable as the color property of that element. You can also use this file to add color variables that use SCSS color transformation functions (lighten, darken, saturate, etc.) without compromising your theme's compatibility with different color schemes.
2020-08-18 13:02:13 -04:00
Joffrey JAFFEUX b98cf565d1
FIX: makes group_show_serializer#is_group_owner follow standards (#10466)
It should only return if is_group_owner, otherwise the field won't be present in json.
2020-08-18 18:30:08 +02:00
Robin Ward bad7c287dd
FIX: Always wait for promise when loading a topic (#10465)
It turns out that `setupController` doesn't always wait when returning a
promise, but the `model` hook does. This fixes issues with the
`page:changed` event firing before the transition has complete.
2020-08-18 11:11:02 -04:00
Joffrey JAFFEUX 93a370863f
FIX: more efficient and resilient widget-dropdown body (#10458) 2020-08-18 13:39:08 +02:00
Vinoth Kannan 562180dd9a
FEATURE: add option to skip new user tips in first notification. (#10462) 2020-08-18 13:43:40 +05:30
Guo Xiang Tan 92b7fe4c62
PERF: Add partial index for non-pm search. 2020-08-18 15:55:08 +08:00
Martin Brennan bb74ccf288
FIX: Add bookmark-list component (#10451)
Moving the bookmark list into its own component to solve click binding issues for external links, because controllers are not the place for DOM manipulation!
2020-08-18 12:15:00 +10:00
Blake Erickson ba9fbb3443 FIX: Composer upload icon regression because of HEIC
Now that HEIC conversion is enabled by default we need to update a few
file extension checks to include `heic` and heif` formats.

https://meta.discourse.org/t/-/144326/23?u=blake

bug reported here:

https://meta.discourse.org/t/-/161197?u=blake
2020-08-17 19:39:26 -06:00
Sam Saffron 38e7b1a049
FIX: when destroying uploads clear card and profile background
There is an fk to user_profile that can make destroying uploads fail
if they happen to be set as user profile.

This ensures we clear this information when destroying uploads.

There are more relationships, but this makes some more progress.
2020-08-18 10:55:16 +10:00
David Taylor 5f7839f0a4
FIX: Allow safari to load and autoplay videos in posts
This improves the reloading workaround in a few ways:
  - Multiple videos in posts are now reloaded. Previously only the first was reloaded.
  - An empty `poster` string is treated the same as a missing attribute
  - If the video is set to autoplay, it will be reloaded (and therefore autoplayed correctly)
2020-08-17 23:48:36 +01:00
Robin Ward e2e51ee348 FIX: Refactor broke wizard 2020-08-17 16:34:12 -04:00
Penar Musaraj 2567bb4a67
DEV: Facilitate replacing category lock icon in components 2020-08-17 16:09:17 -04:00
Robin Ward 1a2156a0c2 REFACTOR: Remove `Discourse.BaseUrl` global 2020-08-17 16:08:40 -04:00
Robin Ward 441ac21053 FIX: Broken when iconList missing 2020-08-17 15:49:32 -04:00
Robin Ward 5b2c306bb8 REFACTOR: Remove `Discourse.HighlightJSPath` from globals
Instead we use the session, and pass that along where necessary.
2020-08-17 15:45:44 -04:00
Penar Musaraj 3745f2bb86
FEATURE: Dark mode alternative logos (#10441) 2020-08-17 15:43:20 -04:00
Robin Ward 386a9d26ec REFACTOR: Remove `Discourse.SvgIconList` and `Discourse.SvgSpritePath`
We use the session instead. This patch also removes some jQuery usage in
favor of regular HTML apis
2020-08-17 15:28:22 -04:00
jahan-ggn 65649eaef0
User card settings (#10302)
* settings implemented

* prettier

* settings updated

* rubocop

* prettier

* Revert "rubocop"

This reverts commit 7805145a7d.

* Revert "prettier"

This reverts commit 2c53f4fa12.

* settings updated and changed

* rubocop

* changes applied

* final changes done

* Server side feature added

* spec changed

* changed user_updater and profile file

* Fix user card specs

* web hook serializer solved

* site-setting changed

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
2020-08-17 12:37:45 -04:00
Mark VanLandingham f2588e1c85
FIX: Clicking on category autocomplete row (#10457) 2020-08-17 11:02:00 -05:00
Joffrey JAFFEUX 6d0eb7178d
FIX: prevents errors on /tags when a tag `constructor` exists (#10449)
This is due to js objects having a constructor property:

```
const obj = {};
obj['constructor'] // return [native code] and not undefined
```
2020-08-17 17:40:34 +02:00
Robert c164e9bbe0
DEV: Add computed property to Create Account modal (#10455)
Carry over the regime used in the Login modal to Create Account to
facilitate overriding of the classes set for the d-modal Component
using a new Computed Property having the same naming convention.
2020-08-17 12:31:41 +01:00
Guo Xiang Tan 872ef82f4d
Revert "PERF: Prefer joins over subquery for `User#private_posts_for_user`."
This reverts commit 05b43e5ae4.
2020-08-17 14:58:47 +08:00
Guo Xiang Tan 05b43e5ae4
PERF: Prefer joins over subquery for `User#private_posts_for_user`.
The subquery here prevents the planner from optimizing the query. As
such, we prefer joining against the requried tables instead.
2020-08-17 14:47:48 +08:00
Kris 630ec7b49c Enable hamburger menu scrolling on mobile, follow-up to 1972364 2020-08-15 20:31:22 -04:00
Robin Ward 58ee947b35 FIX: Mobile group add dropdown was broken
It looks like we removed the bulk add modal but didn't update the mobile
template.
2020-08-14 21:03:41 -04:00
Robin Ward 51a6e96b7f FIX: defer topic was broken 2020-08-14 17:25:37 -04:00
Robin Ward afa9a61080 REFACTOR: These `Discourse` constants do not seem required in vendor 2020-08-14 13:42:15 -04:00
Robin Ward 41fd7a8b72 REFACTOR: Add `themeSettings` to the `helperContext` to avoid a global 2020-08-14 13:34:21 -04:00
David Taylor 8ac85f54fb
DEV: Remove blob: workers from CSP (#10440)
Ace editor is reconfigured to load workers directly from their JS URL. Workers must be on the same origin as the site, so they will not use the CDN.
2020-08-14 18:15:30 +01:00
Robin Ward f52927cd33 REFACTOR: Migrate `screenTrack` to a service 2020-08-14 13:14:17 -04:00
Robin Ward 86aa5d5e48 FIX: `application` controller is not used by the card 2020-08-14 12:49:53 -04:00
Robin Ward 99764d8108 REFACTOR: Don't use container in Scrolling mixin 2020-08-14 12:49:53 -04:00
Robin Ward 37c6fef535 REFACTOR: Remove dead code (property was typo'd, no longer used) 2020-08-14 12:49:53 -04:00
Robin Ward 01e213c930 REFACTOR: Clean up router usage and private APIs 2020-08-14 12:49:53 -04:00
Robin Ward 6a9bde3bf4 REFACTOR: Remove `router:main` and `getOwner` 2020-08-14 12:49:53 -04:00
Robin Ward cf466f7b84 REFACTOR: Simplify `willTransition` 2020-08-14 12:49:53 -04:00
Jarek Radosz 7cc5c5bb31
FIX: DEV: Introduce `@bind` decorator (#10439)
Fixes a bug in `controllers/insert-hyperlink` where `addEventListener` was called with different (anonymous) functions than the matching `removeEventListener` calls.
2020-08-14 17:13:20 +02:00
Guo Xiang Tan 8b811533b1
DEV: Improve readability of setting weights in `SearchIndexer`. 2020-08-14 23:11:41 +08:00
Jarek Radosz a3e2152265
DEV: Add ember-buffered-proxy import shim (#10438)
Just a bit of 🧹
2020-08-14 17:07:17 +02:00
Vinoth Kannan 476d26159a
FEATURE: add new user option `skip_new_user_tips`. (#10437)
And add new site setting `default_other_skip_new_user_tips` in user preferences category.
2020-08-14 19:10:56 +05:30
Jarek Radosz 6287c8e171 FIX: A paste event listener was re-added instead of being removed
cc: @eviltrout 😉
2020-08-14 15:21:27 +02:00
David Taylor 3cf93e9a8f
Revert "DEV: Disable ACE editor worker blobs"
This reverts commit d5463d2a4d.

With S3 assets, CORS prevents loading worker assets directly.
2020-08-14 14:12:11 +01:00
David Taylor d5463d2a4d
DEV: Disable ACE editor worker blobs
This will allow us to remove `blob:` URLs from the worker-src CSP directive
2020-08-14 12:01:46 +01:00
Jarek Radosz be6a73f654 DEV: Fix package.json issues and reroll yarn.lock 2020-08-14 12:00:35 +02:00
Guo Xiang Tan 5819c4cb3b
PERF: Switch to ActiveRecord's upsert in `SearchIndexer`.
On insertion, it uses a single query instead of 2.
2020-08-14 16:15:14 +08:00
Martin Brennan 4670b62969
DEV: IMAP log to database (#10435)
Convert all IMAP logging to write to a database table for easier inspection. These logs are cleaned up daily if they are > 5 days old.

Logs can easily be watched in dev by setting DISCOURSE_DEV_LOG_LEVEL=\"debug\" and running tail -f development.log | grep IMAP
2020-08-14 12:01:31 +10:00
Blake Erickson c2f3c0dc44 FIX: generate_topic_thumbnails job infinitely running for corrupted images
It's possible that the original topic image is broken in some form, so
we shouldn't try and generate a topic thumbnail for it. The fix will
prevent the generate_topic_thumbnails job being enqueued every time the
topic is viewed.
2020-08-13 17:08:32 -06:00
Neil Lalonde d65a839577
FEATURE: allow group membership to unmute categories and tags
For sites that are configured to mute some or all categories and tags
for users by default, groups can now be configured to set members'
notification level to normal from the group manage UI.
2020-08-13 17:20:53 -04:00
Kris 18fb34bf2e formatting follow-up to 32102dd 2020-08-13 17:01:22 -04:00
Kris 32102ddff3 UX: Use the same formatting for both user and group card bios 2020-08-13 16:55:30 -04:00
Mark VanLandingham b9891e3def
FIX: Update preview when autocomplete is clicked (#10430) 2020-08-13 15:42:38 -05:00
Jarek Radosz d0d651d8bc
FIX: Prevent `LockOn` conflicts (#10422)
If there's already a `LockOn` instance, clear its lock before creating creating a new one. Fixes a shaky viewport effect after certain transitions.

Includes:
* Slight refactor (elementId wasn't an id, but a selector - it included the "#" prefix)
* Add support for a[name=X] anchors in `jumpToPost`
* Scope down anchors to the #main element (Embeded fontawesome sprites are causing conflicts, e.g. when given `bed` anchor, `<a name="bed">` was at odds with `<symbol id="bed" viewBox="0 0 640 512">(…)</symbol>`)
2020-08-13 19:39:40 +02:00
Robin Ward ba3ee3444e
FIX: Move queryParams to each discovery controller rather than shared (#10424)
* REFACTOR: `refreshSort` doesn't cause it to sort again, it's misleading

* FIX: Move queryParams to each discovery controller rather than shared

This fixes issues where params previously would not reset between
routes. For example if you added `max_posts=1` to /latest and then went
to a category.

* Add backward compatibility for (action "changeSort") for themes

* FIX: refreshing was not working

* Update app/assets/javascripts/discourse/app/controllers/discovery/topics.js

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

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2020-08-13 11:33:46 -04:00
Jarek Radosz ab5df7b2bd
FIX: Preserve anchors in permalink transitions (#10421)
When visiting a permalink with an anchor (e.g. /important-link#notes) the anchor part was being dropped during redirection.

The change doesn't have a test. Functions like scrollToPost or scrollToElement don't have any effect in the test environment.
2020-08-13 16:44:34 +02:00
Jarek Radosz 7a8442435c
REFACTOR: `LockOn` class (#10428)
Mostly de-jQuery-ification. This refactor tries to closely preserve the original behavior.

Changes:
* Store the interval inside the class (allows using `clearLock()` on `LockOn` objects)
* Extract the interval function to a separate method
* Math.max result is never undefined (per MDN: "[Return value] The largest of the given numbers. If at least one of the arguments cannot be converted to a number, NaN is returned.")
* Replace jQuery's `offset()`
* Private methods be private
* Native `scrollTop` (jQuery's just a wrapper for this)
* `addEventListener`/`removeEventListener`
2020-08-13 16:43:05 +02:00
Mark VanLandingham 2008ecd68e
DEV: Remove incorrect comment in tag/show controller (#10423) 2020-08-13 09:19:09 -05:00
Krzysztof Kotlarek 7194b31443
FEATURE: don't notify about changed tags for a private message (#10408)
* FEATURE: don't notify about changed tags for a private message

Only staff members observing specific tag should receive a notification

* FIX: remove other category which is not used

* FIX: improved specs to ensure that revise was succesful
2020-08-13 17:22:34 +10:00
Vinoth Kannan 310952fd6a FIX: generate topic excerpt when moving posts to new topic.
Currently, it's not generating the excerpt by default. We have to trigger the "Rebuild HTML" action to do it.
2020-08-13 11:30:14 +05:30
Martin Brennan ef461ffd60
FIX: Make sure user preference to open external links in new tab works for bookmark list excerpts (#10409)
Meta post: https://meta.discourse.org/t/bookmark-page-does-not-respect-open-all-external-links-in-new-tab-user-preference/160118
2020-08-13 14:56:13 +10:00
Kris 9bc992dce4 follow-ups to 1972364: increase notification limit, make show-all a link 2020-08-12 17:14:48 -04:00
Kris 95a454abb6 specificity fix to d1c570c 2020-08-12 16:03:08 -04:00
Vinoth Kannan 6a8562894a FIX: change the controller method name to match its new name.
The controller method `_changeFilters` is now changed to `changeFilters` in the commit 1fc58b5a4e. But it was not modified in the `admin-tools` service script.
2020-08-13 00:58:35 +05:30
Blake Erickson c68563a281 DEV: Improve API usage when creating * updating categories
The category model already has a default value for `color` and
`text_color` so they don't need to be required via the API. The ember UI
already requires that colors be selected.

The name of the category also doesn't need to be required when updating
the category either because we are already passing in the id for the
category we want to change.

These changes improve the api experience because you no longer have to
lookup the category name, color, or text color before updating a single
category attribute. When creating a category the name is still required.

https://meta.discourse.org/t/-/132424/2
2020-08-12 12:28:29 -06:00
Jeff Wong 70d4420c8e DEV: Add profile-hidden selector to user page for styling 2020-08-12 09:48:42 -07:00
Robin Ward 9525d3506b FIX: Heisentest with topic timings
We trigger `/topics/timings` requests without ever caring about the
promise afterwards, so they can bleed from one test to another.

If you're very unlucky, this might happen and then the next test
is testing a subfolder, which means you end up with a path like
`/forum/topics/timings` which is not caught by pretender and causes the
suite to fail.

It's easier (and faster) to never send these requests in test mode
than to track the ajax requests and abort them between runs.
2020-08-12 12:27:17 -04:00
Vinoth Kannan fc5111508f FIX: allow mods to choose restricted categories as parent category.
Currently moderators can't choose a category with only “See” permission as a parent in `edit-category` modal.
2020-08-12 20:58:52 +05:30
Rafael dos Santos Silva 28669dfeb2
PERF: Faster TL3 promotion replies needed calculation (#10416)
Removing the LIMIT makes PostgreSQL use index_posts_on_user_id_and_created_at
which is much faster overall.

Before: 22 seconds
After: 100 ms
2020-08-12 11:28:34 -03:00
Mark VanLandingham 00a0767c35
DEV: Remove directory-toggle component (#10413) 2020-08-12 08:11:32 -05:00
Penar Musaraj 6dd9f2eca2
FIX: color scheme selection with non-default theme
This fixes an issue where a non-default theme set to use the base color
scheme (i.e. the theme had an empty `color_scheme_id`) was loading the
default theme's color scheme instead.
2020-08-12 08:49:13 -04:00
Guo Xiang Tan 808e84a856
FIX: Expose PG headline highlighting for all search results. 2020-08-12 16:43:47 +08:00
Penar Musaraj 8633e3cae8
FIX: iOS/iPadOS freezing when changing notification level in topic footer 2020-08-11 22:39:17 -04:00
Kris d1c570cf2c Hamburger menu needs to be able to scroll, follow-up to 1972364 2020-08-11 22:33:51 -04:00
Martin Brennan 95b71b35d6
FEATURE: IMAP delete email sync for group inboxes (#10392)
Adds functionality to reflect topic delete in Discourse to IMAP inbox (Gmail only for now) and reflecting Gmail deletes in Discourse.

Adding lots of tests, various refactors and code improvements.

When Discourse topic is destroyed in PostDestroyer mark the topic incoming email as imap_sync: true, and do the opposite when post is recovered.
2020-08-12 10:16:26 +10:00
jbrw 6391db5921
FIX: use correct site setting when uploading images 2020-08-11 18:13:55 -04:00
Penar Musaraj c05aced094
FIX: Invalidate cache when updating color scheme colors (#10417) 2020-08-11 16:28:59 -04:00
Joe 1c941a19d7 DEV: removes the Vincent theme from the "popular theme" list
This theme is currently not maintained so it shouldn't be on that list
2020-08-12 03:11:05 +08:00
Vinoth Kannan f3154e783f UX: preload muted categories list to prevent rendering delay. 2020-08-12 00:34:40 +05:30
Blake Erickson ee366f7ac7 FIX: Ensure load more directory items has a .json url
The `/directory_items` route needs to have a .json url, but the rails
url helper `_path` doesn't return the format of the route.

I tried passing in a format options to `directory_items_path`. Which
works in the rails console

```
[8] pry(main)> directory_items_path(params.merge(:format => :json))
=> "/directory_items.json?page=1"
```

but when I added that some logic to the controller it comes out as

```
/directory_items?format=json&page=1
```

(which is actually how I expect it to work based on how you pass in the
format param). Anyways, because I couldn't figure out how to pass a
format to the `_path` helper I just used URI.parse to append `.json`
manually.
2020-08-11 12:43:55 -06:00
Kris cfa37d1670 prevent search panel more link from causing horizontal overflow 2020-08-10 22:15:42 -04:00
Kris 1972364d0f
REFACTOR: Update the notification menu to remove scrolling (#10371) 2020-08-10 16:17:15 -04:00
Joe e3bc8f34ed UX: ensures search results wrap on mobile 2020-08-11 02:17:41 +08:00
David Taylor fe7a7ecf6c
FIX: Include secure media URLs when linking post uploads (#10404)
Normally, secure media urls are linked like `/secure-media-uploads/...`. In this case, uploads were already being linked correctly.

But sometimes (e.g. when pulling hotlinked onebox images) secure media is referenced with a full domain name (`//example.com/secure-media-uploads`). This commit ensures that those uploads are also linked correctly.
2020-08-10 17:59:29 +01:00
Mark VanLandingham b7a092bd28
FEATURE: Group category permissions tab (#10388) 2020-08-10 09:49:05 -05:00
Robin Ward 232d277833 REVERT: Resetting the filters is causing double transitions 2020-08-07 16:41:41 -04:00
Penar Musaraj 31e9e0c41b
UX: Update header background color in mobile app webview
Sends the updated value when switching color schemes.
2020-08-07 16:13:22 -04:00
Jordan Vidrine 77a9c6aa80
FIX: Smaller header font size for published page (#10398) 2020-08-07 13:46:08 -05:00
Rafael dos Santos Silva a97e36cfda
FEATURE: Block vibration in Firefox Android (#10389)
Legacy Firefox Android has some quirks around vibration where it:

- asks for permission
- doesn't persist the permission

This makes the default like vibration popup a permission on Firefox
Android <= 68.

This isn't the case (yet?) on their new Firefox which is rolling out
worldwide right now.

I'd say we merge this now and revert in 3 months or so when
https://arewefenixyet.com/ shows a full rollout.
2020-08-07 15:38:53 -03:00
Régis Hanol bc63232d2e
FIX: sync reviewable count when opening the hamburger menu (#10368)
When a tab is open but left unattended for a while, the red, green, and blue
pills tend to go out of sync.

So whevener we open the notifications menu, we sync up the notification count
(eg. blue and green pills) with the server.

However, the reviewable count (eg. the red pill) is not a notification and
is located in the hamburger menu. This commit adds a new route on the server
side to retrieve the reviewable count for the current user and a ping
(refreshReviewableCount) from the client side to sync the reviewable count
whenever they open the hamburger menu.

REFACTOR: I also refactored the hamburger-menu widget code to prevent repetitive uses
of "this.".

PERF: I improved the performance of the 'notify_reviewable' job by doing only 1 query
to the database to retrieve all the pending reviewables and then tallying based on the
various rights.
2020-08-07 18:13:02 +02:00
jbrw 3593e582a3
FIX - limit number of embedded media items in a post (#10391)
* FIX - limit number of embedded media items in a post

* Add renamed settings to DeprecatedSettings
2020-08-07 12:08:59 -04:00
Penar Musaraj 9c9aa21726
Add site setting to pick dark mode color scheme (#10390)
Co-authored-by: Robin Ward <robin.ward@gmail.com>
2020-08-07 08:52:47 -04:00
Joffrey JAFFEUX b86198198f
FIX: removes persistedQueryParams as it should work out of the box (#10394)
This hack is only attempting to hide something which should have been working in core and for which we should provide a fix soon. Also it's not working as it should.
2020-08-07 09:51:37 +02:00
Guo Xiang Tan cf2797bf58
DEV: Fix lint take 2. 2020-08-07 13:17:51 +08:00
Guo Xiang Tan e2fc05705f
DEV: Fix lint. 2020-08-07 13:16:17 +08:00
Guo Xiang Tan e60c74d3c1
FEATURE: Use PG `ts_headline` for highlighting topic title in search. 2020-08-07 12:43:09 +08:00
Guo Xiang Tan 1d2ba8fd52
DEV: No need to highlight search if PG headline generation is used. 2020-08-07 10:50:30 +08:00
Krzysztof Kotlarek fb9c2e5f89
FEATURE: notification for vote plugin (#10384)
This must exist in core as we want to see a correct notification after disable of the voting plugin.
2020-08-07 09:51:16 +10:00
Blake Erickson 149801f99a FIX: PM participants list refreshing after inviting
When inviting users to a PM a small post is created showing that you
invited the user, but the actual list of participants never updated
until you refreshed the page or interacted with the private-message-map
widget triggering it to refresh. This change will trigger a refresh on
the private-message-map widget ensuring that the UI is updated with the
current list of participants.
2020-08-06 14:57:55 -06:00
Kris 7a1816ce23
DEV: Set application template plugin outlets to tagName="" (#10382) 2020-08-06 16:01:24 -04:00
Robin Ward f03f58e52c REFACTOR: Remove `Discourse` constants from `cleanDOM` 2020-08-06 15:34:20 -04:00
Robin Ward db443d2289 REFACTOR: Use the session for the `ServiceWorkerURL` 2020-08-06 15:24:43 -04:00
Robin Ward 036a79d273 REFACTOR: Use `isTesting()` instead of `Discourse.testing` 2020-08-06 15:18:25 -04:00
Robin Ward a80d749b9d REFACTOR: Remove an unnecessary `Discourse.__container__` 2020-08-06 15:14:20 -04:00
Robin Ward 7cd11bad0c REFACTOR: Use the session to track assetVersion/requiresRefresh
This saves us having to put the data on `Discourse`
2020-08-06 15:09:13 -04:00
Penar Musaraj af63871d4d
FIX: Missing bottom border in select-kit color list settings 2020-08-06 14:52:17 -04:00
Robin Ward 7df57b35da REFACTOR: Remove `Discourse.__widget_helpers`
It's now a variable in the context where the templates are created.
2020-08-06 14:35:46 -04:00
Robin Ward 792bd3faff Remove `getURL` and `getURLWithCDN` deprecations, they have been removed 2020-08-06 14:01:31 -04:00
Neil Lalonde 1ca81fbb95
FEATURE: set notification levels when added to a group (#10378)
* FEATURE: set notification levels when added to a group

This feature allows admins and group owners to define default
category and tag tracking levels that will be applied to user
preferences automatically at the time when users are added to the
group. Users are free to change those preferences afterwards.
When removed from a group, the user's notification preferences aren't
changed.
2020-08-06 12:27:27 -04:00
Jarek Radosz cd4f251891
FEATURE: Poll breakdown 2.0 (#10345)
The poll breakdown modal replaces the grouped pie charts feature.

Includes:

* MODAL: Untangle `onSelectPanel`
Previously modal-tab component would call on click the onSelectPanel callback with itself (modal-tab) as `this` which severely limited its usefulness. Now showModal binds the callback to its controller.

"The PR includes a fix/change to d-modal (b7f6ec6) that hasn't been extracted to a separate PR because it's not currently possible to test a change like this in abstract, i.e. with dynamically created controllers/components in tests. The percentage/count toggle test for the poll breakdown feature is essentially a test for that d-modal modification."
2020-08-06 17:57:06 +02:00
Penar Musaraj 6fdc711b4a
FEATURE: Allow users to opt out of automatic dark mode (#10377) 2020-08-06 09:45:37 -04:00
Joe c047e16285 UX: ensure CSS vars are loaded in the Wizard stylesheet
The in-app select-kit stylesheet references some of the CSS vars we recently added. This commit ensures that those vars are available when that sheet is complied since the wizard lives outside of the app.
2020-08-06 19:19:15 +08:00
Sam Saffron ba482c251c
FIX: stop sync of tracking state when list is filtered
This stops sync of tracking state when list is filtered, in the past this
would cause the tracking state to go off wack.

Additionally this introduces an alias for "filter=tracking", called "f=tracking"

This was done cause the term "filter" is used internally in 2 different ways
the main way is for /unread /new filtering.

Trying to also call a query param "filter" causes enormous amounts of
internal pain, this circumvents the issue.
2020-08-06 16:34:02 +10:00
Guo Xiang Tan 255b0e9f14
PERF: Replace video and audio links in search blurb while indexing.
In the near future, we will be swtiching to PG headlines to generate the
search blurb. As such, we need to replace audio and video links in the
raw data used for headline generation. This also means that we avoid
replacing links each time we need to generate the blurb.
2020-08-06 12:25:03 +08:00
David Taylor ceb858c70a
PERF: Release post_upload records when downloaded image is removed (#10379)
Previously we would unconditionally keep all images downloaded via pull_hotlinked_images, even if they are later removed from the post. This commit removes that logic, and relies on the existing link_post_uploads process to pick up the downloaded images in `cooked`. Specs are added to ensure this is working correctly for regular hotlinked images, and for oneboxes.
2020-08-06 10:06:34 +10:00
Robin Ward 09254410ea FIX: Only raise proper `"error"` messages
Also support "1" for `QUNIT_FAIL_FAST` to make it consistent with other
arguments.
2020-08-05 16:27:06 -04:00
Robin Ward f1b6b1bd0e FIX: Pretender errors were being swallowed
Lots of test were broken and needed fixes.
2020-08-05 15:48:57 -04:00
Robin Ward b0564205d9 FIX: Raise errors for broken pretender responses in test mode 2020-08-05 15:48:56 -04:00
Vinoth Kannan aa017f276f FIX: replace `fullPath` while rewriting the `/my/` URLs.
And added the tests. Follow-up to cdca5a2ee4
2020-08-05 23:22:15 +05:30
jbrw 67e8bc5342
FEATURE - allow category group moderators to split/merge topics (#10351) 2020-08-05 10:33:25 -04:00
Joffrey JAFFEUX b6e475a8f3
FIX: ensures shadow has last_posted_at before comparing to site setting (#10374) 2020-08-05 13:20:51 +02:00
David Taylor cb12a721c4
REFACTOR: Refactor pull_hotlinked_images job
This commit should cause no functional change
- Split into functions to avoid deep nesting
- Register custom field type, and remove manual json parse/serialize
- Recover from deleted upload records

Also adds a test to ensure pull_hotlinked_images redownloads secure images only once
2020-08-05 12:14:59 +01:00
Bianca Nenciu 42f62a9e63
FIX: Shows all_results if current settings category has no results (#10358)
Searching for a specific setting only showed results from the current selected category. Before fixing fd02856, it automatically redirected the user to all_results. This was a problem because the redirect always happened and there was no way to share a link to a specific category.

The fix to this bug is to simply redirect the user to all_results if there are no results to be displayed.
2020-08-05 09:39:54 +02:00
Simon Cossar f78792c779
FEATURE: Add category_id to TopicViewWordpressSerializer (#10372) 2020-08-05 11:50:15 +10:00
Kane York 8850f51fd0
FIX: Show "group members forbidden" message on mobile (#10370)
This commit fixes an oversight in commit 88359b0f16.
2020-08-04 16:16:52 -07:00
Kris eb619c8e98 prevent long email addresses from breaking admin table layout 2020-08-04 16:47:50 -04:00
tshenry 0cda5b9d55
FEATURE: New plugin outlet for category-heading (#10363) 2020-08-04 12:52:43 -07:00
Vinoth Kannan cdca5a2ee4 FIX: rewrite of `/my/`URL should work on sub directory site too. 2020-08-05 00:59:10 +05:30
Joffrey JAFFEUX 4593bb60c5
FIX: allows to change a user group notification level (#10369)
The current code has an ambiguous name of "user" which is actually not a user model, the real user model is accessible on the model key of user.
2020-08-04 21:23:55 +02:00
Penar Musaraj fb91320cba
UX: Refactor pikaday month prev/next button styling
And topic-list last poster halo effect
2020-08-04 14:39:25 -04:00
Robin Ward a1ec711373 FIX: Previous fix comitted the wrong thing and was broken :( 2020-08-04 13:46:26 -04:00
Robin Ward 6da7a97eee FIX: Exclude shared drafts from digests 2020-08-04 13:35:48 -04:00
Neil Lalonde 1bef008a1e
FIX: current value of flair icon missing in group manage UI 2020-08-04 12:41:14 -04:00
Robin Ward 92b26ecbfb REFACTOR: Move Page title / focus / counts logic to service
We had a handful of methods attached to the root `Discourse` object
related to focus and notification counts.

This patch pulls them out into a service called `document-title` for
updating the title, and a component called `d-document` to attach
and listen for browser events related to focus.

It also removes some computed properties and observers in favor of plain
old Javascript objects.
2020-08-04 12:02:25 -04:00
Mark VanLandingham b76731d722
FEATURE: Invite emails to groups from add member modal (#10308) 2020-08-04 10:02:01 -05:00
Penar Musaraj 413fa49032
UX: Refactor lightbox hover drop shadow
For parity with auto dark mode switching, this includes a subtle effect in dark themes too.
2020-08-04 10:43:18 -04:00
Bianca Nenciu 25505978d0
FIX: Check if selectable avatar with SHA1 2020-08-04 16:20:16 +03:00
Joffrey JAFFEUX 8a0478b97d
DEV: adds plugin api to add custom recipients of a post revision (#10367)
* DEV: adds plugin api to add custom recipients of a post revision

Usage:

```
add_post_revision_notifier_recipients do |post_revision|
  [78]
end
```
2020-08-04 11:57:33 +02:00
Guo Xiang Tan 3b08b15855
PERF: Remove one extra call to Redis when searching. 2020-08-04 14:02:02 +08:00
Martin Brennan 5a3494b1e1
FIX: IMAP archive fix and group list mailbox code unification (#10355)
* Fixed an issue I introduced in the last PR where I am just archiving everything regardless of whether it is actually archived in Discourse man_facepalming
* Refactor group list_mailboxes IMAP code to use providers, add specs, and add provider code to get the correct prodivder
2020-08-04 14:19:57 +10:00
Penar Musaraj c937afc75e
FEATURE: automatic dark mode (#10341)
A first step to adding automatic dark mode color scheme switching. Adds a new SCSS file at `color_definitions.scss` that serves to output all SCSS color variables as CSS custom properties. And replaces all SCSS color variables with the new CSS custom properties throughout the stylesheets. 

This is an alpha feature at this point, can only be enabled via console using the `default_dark_mode_color_scheme_id` site setting.
2020-08-03 22:57:10 -04:00
Sam Saffron eb18f91cf7
DEV: new api to iterate through tracked topics
`topicTrackingState.forEachTracked(topic,isNew,isUnread)` can be used to
iterate through tracking state efficiently.

This is handy for extension looking at subsets of tags and categories.
2020-08-04 10:40:03 +10:00
Kris 5e46ec8b76 width fix for category chooser in move posts modal 2020-08-03 17:44:11 -04:00
Penar Musaraj 52b864facf
FIX: bug with sharing when used outside a topic
Followup to ac76bfb, fixes share buttons in topic lists (only used in themes or plugins)
2020-08-03 16:27:11 -04:00
Bianca Nenciu 2682da81ad
FIX: Get correct selectable avatar from URL (#10339)
The URL for selectable avatars was 'cooked' which means that the find_by
method was not enough.
2020-08-03 17:15:41 +03:00
Penar Musaraj e6349685d3
UX: Uniform focus styles for composer inputs/textarea (#10296)
Uses a thin border as indicator that element is in focus for all editable items in the composer (inputs, select kit, textarea).

 Disables a default iOS style that has a blinking background color on inputs/textareas
2020-08-03 10:01:04 -04:00
Gerhard Schlager 957e851ffe Revert "FIX: Regularly reset unknown extension of uploads"
This reverts commit cc7b24b88b as it shouldn't be needed anymore for new uploads.
2020-08-03 13:37:32 +02:00
Joffrey JAFFEUX eb61916e23
UX: allows to navigate widget dropdown with tab and enter (#10356) 2020-08-03 10:37:30 +02:00
Bianca Nenciu 12913a46e4
FIX: Reset max_posts query parameter (#10334) 2020-08-03 11:19:36 +03:00
Penar Musaraj ac76bfb400
Disable social media sharing on private categories, unlisted topics (#10349)
* Do not show social media sharing on private categories, unlisted topics

* Disable quote sharing entirely in private categories and unlisted topics
2020-08-03 17:06:09 +10:00
Blake Erickson 4dae9d458b
FIX: Respect query params for latest.rss (#10350)
Apparently latest.json and latest.rss are not routed to the same
controller methods. This change allows for any passed in query
parameters to actually be applied to the rss route.

This came in as a request on meta:

https://meta.discourse.org/t/-/155812/6
2020-08-03 17:03:58 +10:00
Krzysztof Kotlarek 515699776b
FIX: set mailing_list_mode to false when unsubscribing from all (#10354)
Currently, we only reset `email_digests`, `email_level` and `email_messages_level` when the user wants to unsubscribe from all email.

`mailing_list_mode` should be reset as well
2020-08-03 16:59:54 +10:00
Martin Brennan 2920988b3a
FIX: IMAP sync email update uniqueness across groups and minor improvements (#10332)
Adds a imap_group_id column to IncomingEmail to deal with an issue where we were trying to update emails in the mailbox, calling IncomingEmail.where(imap_sync: true). However UID and UIDVALIDITY could be the same across accounts. So if group A used IMAP details for Gmail account A, and group B used IMAP details for Gmail account B, and both tried to sync changes to an email with UID of 3 (e.g. changing Labels), one account could affect the other. This even applied to Archiving!

Also in this PR:

* Fix error occurring if we do a uid_fetch and no emails are returned
* Allow for creating labels within the target mailbox (previously we would not do this, only use existing labels)
* Improve consistency for log messages
* Add specs for generic IMAP provider (Gmail specs still to come)
* Add custom archiving support for Gmail
* Only use Message-ID for uniqueness of IncomingEmail if it was generated by us
* Various refactors and improvements
2020-08-03 13:10:17 +10:00
Joffrey JAFFEUX 8a9e4504fe
DEV: allows to decouple csv-uploader texts from bulk invite (#10344) 2020-08-01 10:29:09 +02:00
Robin Ward 0b3f963804 FIX: Removes an error in the console in test mode 2020-07-31 14:06:52 -04:00
Régis Hanol da7e6b1f7e DEV: make rubocop 🤖 happy 2020-07-31 18:16:54 +02:00
Régis Hanol 3f59d0cffe
DEV: prevent initialized constant warning
Was tired of seeing the following warnings in the logs

```
/discourse/app/jobs/scheduled/old_keys_reminder.rb:7: warning: already initialized constant Jobs::OldKeysReminder::OLD_CREDENTIALS_PERIOD
/discourse/app/jobs/scheduled/old_keys_reminder.rb:7: warning: previous definition of OLD_CREDENTIALS_PERIOD was here
```
2020-07-31 18:05:12 +02:00
Blake Erickson 8de635fe92
DEV: Show message when cannot invite user to PM (#10336)
* DEV: Show message when cannot invite user to PM

When inviting a user to a PM return a message that says, "Sorry, this
user can't be invited." if they have been muted or are not in a users
allowed pm users list.

* Minor refactor & improved some text
2020-07-31 09:52:19 -06:00
Jordan Vidrine 831802aedc
Change pp to published-page (#10343)
* UI: Markdown Code Wrapping

* pp -> published-page

change to match previous syntax

* pp -> published-page

change to match previous syntax
2020-07-31 09:24:08 -05:00
Penar Musaraj e6dbb4fcf5
DEV: Live refresh all themes when watching stylesheets (#10337) 2020-07-30 19:03:24 -04:00
Simon Cossar 3d9eb3e085
Rename options passed to Readability::Document back to whitelist and blacklist (#10340) 2020-07-30 12:56:48 -07:00
Vinoth Kannan 6a1746a0c5
FEATURE: add expandable muted categories ui to `/categories` page. (#10303)
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2020-07-30 23:32:51 +05:30
Jordan Vidrine f90e02162b
UI: Styling for Published Page (#10335)
* UI: Styling for Published Page

Styling to look more visually connected to Discourse
2020-07-30 10:25:28 -05:00
Dan Ungureanu 5e2e374c72
DEV: Fix build
Follow-up to bd3c0dd59f.
2020-07-30 13:10:16 +03:00
Dan Ungureanu bd3c0dd59f
FEATURE: Show login button on error page if user is not logged in 2020-07-30 12:34:34 +03:00