Commit Graph

35305 Commits

Author SHA1 Message Date
Arpit Jalan
5ff84be8cc FIX: do not strip nil string 2019-11-13 16:58:14 +05:30
David Taylor
b27e009655 DEV: Temporarily remove NoChdir cop
We inherit this rubocop config from plugins and other projects, so the `require` line does not work reliably.
2019-11-13 10:26:40 +00:00
David Taylor
9fea43e46a
DEV: Remove use of cd in the app (#8337)
`FileUtils.cd` and `Dir.chdir` cause the working directory to change for the entire process. We run sidekiq jobs, hijacked requests and deferred jobs in threads, which can make working directory changes have unintended side-effects.

- Add a rubocop rule to warn about usage of Dir.chdir and FileUtils.cd
- Added rubocop:disable for scripts used outside the app
- Refactored code using cd to use alternative methods
- Temporarily skipped the rubocop check for lib/backup_restore. This will require more complex refactoring, so I will create a separate PR for review
2019-11-13 09:57:39 +00:00
Joffrey JAFFEUX
e4df3792f6
DEV: provides a way to hook into createWidget constructor (#8340) 2019-11-13 09:29:12 +01:00
Joffrey JAFFEUX
38a18b7aa0
DEV: call destroy() on widget when glue is cleaned up (#8338) 2019-11-13 09:28:43 +01:00
Jeff Wong
3b36326cb7 Add plugin outlet after flagged post bodies 2019-11-12 17:47:56 -08:00
tshenry
9caec39aef
UX: Add CSP documentation link to content_security_policy_script_src setting 2019-11-12 14:57:47 -08:00
Roman Rizzi
1c179177e7
REFACTOR: Attach resize controls to images from the markdown pipeline (#8314) 2019-11-12 17:32:37 -03:00
Neil Lalonde
7711df40e6
REFACTOR: redo DiscourseTagging.filter_allowed_tags (#8328)
This method had grown into a monster. Its query had bugs
that I couldn't fix, and new features would be hard to add.
Also I don't understand how it all works anymore...
Replace it with common table expressions that can be queried
to generate the results we need, instead of subtracting
results using lots of "NOT IN" clauses.

Fixed are bugs with tag schemas that use combinations of
tag groups, parent tags, and one-tag-per-topic restrictions.
For example: https://meta.discourse.org/t/130991/6
2019-11-12 14:28:44 -05:00
Robin Ward
4422d9a4bf DEV: Provide a nicer error when JSON is malformed
This is very useful for development. It will give a much nicer error if
the JSON that comes back from the server is missing a required key.
2019-11-12 13:04:52 -05:00
romanrizzi
c9bd463e9d DEV: Let is not supported, use var instead 2019-11-12 14:58:16 -03:00
David Taylor
836b3f4d82
FIX: Do not deactivate admin accounts with recent posts or api keys (#8342)
This prevents 'bot' users being deactivated
2019-11-12 16:56:01 +00:00
Mark VanLandingham
213ebc3b32
DEV: Deprecation warning for aliased module usage (#8341) 2019-11-12 10:20:14 -06:00
David Taylor
cf4356cd81 UX: Do not add leading/trailing spaces when copying API key in Firefox
If there is any other whitespace in the container, then Firefox will add a leading/trailing space when double clicking the key. This commit wraps the key in a div with no whitespace, to work around the problem.
2019-11-12 16:00:57 +00:00
Robin Ward
f49494b0bf REFACTOR: Remove a few Discourse.Site globals 2019-11-12 10:53:22 -05:00
Robin Ward
afadf361b3 REFACTOR: idMap should be a private API 2019-11-12 10:53:22 -05:00
Robin Ward
7f651b9666 REFACTOR: Deprecate Discourse.Site and Discourse.User 2019-11-12 10:53:22 -05:00
Mark VanLandingham
3dd2f2f701
DEV: Remove RSS feed polling in favor of plugin (#8233) 2019-11-12 09:49:02 -06:00
Robin Ward
6e481851e7 REFACTOR: Don't generate Discourse constants for mixins 2019-11-12 10:21:43 -05:00
David Taylor
5f927ceeb3
DEV: Display a warning when themes hard-code optimized image links (#8304) 2019-11-12 14:30:19 +00:00
Dan Ungureanu
bbcce08712
FIX: Update quotes after moving posts (#8326) 2019-11-12 15:16:39 +02:00
Daniel Waterworth
241d9a3034 FIX: Topic lists filtered by tag and a specified filter don't work
This was a regression caused by 59241df2
2019-11-12 11:34:52 +00:00
Jarek Radosz
17bca00661 DEV: Run prettier 2019-11-12 12:07:19 +01:00
Jarek Radosz
9b841ea83f DEV: Run prettier 2019-11-12 11:49:31 +01:00
Jarek Radosz
5d4b240453
DEV: Provide radix argument to parseInt (#8281)
* DEV: Provide radix 10 argument to parseInt

* DEV: Provide radix 16 argument to parseInt

* DEV: Remove unnecessary parseInt calls

* Fix year formatting

parseInt was used here to convert decimals to ints
2019-11-12 10:47:42 +01:00
Krzysztof Kotlarek
69266f60ed FIX: tag and category watchers regression (#8336)
I made a regression here 17366d3bcc (diff-ddeebb36d131f89ca91be9d04c2baefaR10)

When the tag is added, people watching specific tag are notified but also people watching specific category.

Therefore, `notify_post_users` should accept options who should be notified.

So when `category` is added to the topic, users watching topic and users watching category are notified.

When `tag` is added to the topic, users watching topic and users watching tag are notified

Finally, when a new post is created, everybody is notified, topic watchers, category watchers, tag watchers.
2019-11-12 16:44:46 +11:00
Gerhard Schlager
6ebffaaf6e FIX: Better error handling for invalid locale bundle versions 2019-11-11 22:30:32 +01:00
Robin Ward
34665d3f96 FIX: In case @ember/object hasn't been loaded yet 2019-11-11 15:56:58 -05:00
Robin Ward
e39d89ecd9 REFACTOR: Remove InputValidation which was simply an Ember.Object 2019-11-11 15:48:56 -05:00
Daniel Waterworth
211410c3b9 DEV: It doesn't make sense for a filterMode to be weekly, quarterly, etc 2019-11-11 18:46:27 +00:00
Robin Ward
da04c602ba REFACTOR: Remove debounce to discourseDebounce
Otherwise it can be confused with the ember debounce
2019-11-11 13:34:01 -05:00
Robin Ward
e8dae447bd REFACTOR: Remove discourse/lib/throttle 2019-11-11 13:21:03 -05:00
Daniel Waterworth
4ddb69e9c6 DEV: Removed needless indirection
An artifact of when tagging was a plugin no doubt.
2019-11-11 17:59:26 +00:00
Daniel Waterworth
e79cec9fc7 DEV: Remove handling of category top menu items
Support for these kinds of navigation items was dropped in 88f52514, but
the code for handling these menu items was never removed.
2019-11-11 17:36:29 +00:00
Dan Ungureanu
55bdd9e6a2
FIX: Do not skip some emails in user search (#8317)
It used to skip the email addresses containing the plus sign.
2019-11-11 18:42:45 +02:00
Dan Ungureanu
6672dcc985
FIX: Keep emoji images in group bio excerpt (#8329) 2019-11-11 18:42:08 +02:00
Simon Cossar
544a1379b6
Reference posts table for deleted_at and user_id (#8332) 2019-11-11 11:03:57 -05:00
Mark VanLandingham
20266325fc combined import definitions in discourse-loader 2019-11-11 10:37:21 -05:00
Mark VanLandingham
1bbb9b30fc DEV: Import isNone for @ember/utils 2019-11-11 10:37:21 -05:00
Gerhard Schlager
c04369ed8f
DEV: Revert to Bundler 1.17
Follow-up to a2d6169a5e
2019-11-11 15:37:13 +01:00
Robin Ward
0c8ae1e849 FIX: More missing RSVP imports 2019-11-11 09:25:33 -05:00
Robin Ward
2a6713c2ba FIX: Was using a native browser Promise instead of RSVP 2019-11-11 09:23:26 -05:00
Vinoth Kannan
6e3601469c FIX: use correct class variable to get notification levels. 2019-11-11 18:57:14 +05:30
Vinoth Kannan
12bc6ce8c1 FIX: remove magic numbers in notification levels.
ba5b78a348
2019-11-11 18:18:33 +05:30
Sam Saffron
0c0192e7da DEV: disable all upload recovery specs
These specs are inherently fragile when they are run in a concurrent mode
in CI.

One process will create an upload, another will destroy the upload on disk
at the same time. We need a new safe mechanism here.
2019-11-11 16:04:18 +11:00
Sam Saffron
a2d6169a5e DEV: upgrade mini_racer
This is done to fix a compatibility issue with Ruby 2.7, it ensures we clean
up fds for a pipe we use to track timeouts in mini racer.
2019-11-11 15:36:16 +11:00
Sam Saffron
91daafc674 DEV: correct implementation of expiry api
Previously we were always hard-coding expiry, this allows the secure session
to correctly handle custom expiry times

Also adds a ttl method for looking up time to live
2019-11-11 11:18:12 +11:00
Sam Saffron
bf0ef73286 DEV: correct rake task used to grab admin key
We amended it so "api_key:get" is no longer supported and instead we are
more explicit. This matches that change and fixes the bench.
2019-11-11 10:23:14 +11:00
Sam Saffron
b68eab2b46 DEV: remove deprecated syntax
Ruby 2.7 is going to deprecate "Magic Proc Init". This feature is enormously
magical anyway and the new code is far easier to comprehend.
2019-11-11 09:36:40 +11:00
Blake Erickson
15f6f57cdc DEV: Add update message for an outdated mail-receiver
Previous versions of the mail-receiver used query based api credentials,
if we detect this we will show a message in the admin panel to update
the mail receiver.
2019-11-08 17:32:22 -07:00