Commit Graph

35102 Commits

Author SHA1 Message Date
786fcceb62 Return full URLs in review serializer for both post and topic
Return full URLs, this fixes reviewable links to support subfolder
2019-11-14 15:58:21 -08:00
3b16eb7abb FIX: Confirm new email with backup codes enabled
This is a fix for this bug:

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

where rails would throw a missing template error when trying to confirm
a new email address when you had two factor backup codes enabled.

Apparently this feature broke during this commit:

68d35b14f4b5193c1bae0f175b9e461152e13ac7

when a partial that contained a lot of javascript was removed most
likely because it didn't comply with our Content Security Policy, so as
a fix I rewrote the previous js functionality without using any
javascript and then added a spec to verify that the correct backup code
form is displayed when that page is loaded.
2019-11-14 16:27:42 -07:00
ff355ad204 FIX: Don't show bots as post readers 2019-11-14 17:53:52 -03:00
f87d38fc7c Use correct variable name 2019-11-14 17:46:20 -03:00
067696df8f DEV: Apply Rubocop redundant return style 2019-11-14 15:10:51 -05:00
be15abcf7f DEV: Add RedundantReturn style check to Rubocop 2019-11-14 14:42:36 -05:00
6c16d5762c No need for return in last statement of method 2019-11-14 14:32:22 -05:00
59ee89f0b7 UX: Adds +n indicator in PM topic list (#8353)
Shows the number of additional PM recipients in list when there are more than 5.
2019-11-14 14:14:23 -05:00
d4b7c028fa REFACTOR: Move upload utilities to their own file 2019-11-14 12:51:08 -05:00
c83ae9a79f DEV: Add option to login at beginning of smoke tests
This is useful for testing sites which do not have any public topics.
2019-11-14 18:28:15 +01:00
f175afa0d9 FIX: Revert mobile jump to last post behaviour
Disables jumping to bottom of the page (added in 87f0b56) for mobile devices.

Fixes a regression with the mobile jump tool, and avoids users having to scroll up lots on mobile, since suggested topics and site footers can be lengthy.
2019-11-14 11:15:11 -05:00
73e33ce243 DEV: send url string to FileHelper and refactor another open-uri call
FileHelper.download requires a string not a URI. I also found another
instance of using open-uri directly and swapped it out to use
FileHelper.

I also updated it to not `read` a file if it comes back nil.

Follow up to: fe01099a38f791124130d0adc35f755fb0d5a11b
2019-11-14 08:25:30 -07:00
f72730703a Update translations 2019-11-14 15:41:42 +01:00
f2da630c19 FIX: SVG Sprite version hash should be based on bundle result
This version hash is used for the filename, and so browsers/CDNs cache based on it. Previously the version hash was based only on the list of requested icons. This can cause issues in a couple of situations, most commonly when developing themes with custom icons:

- A requested icon does not exist, and then later is added to the theme. The bundle output changes, but the hash did not
- The SVG content of an icon changes, but the name of the icon does not. The bundle output changes, but the hash did not
2019-11-14 13:20:16 +00:00
fe01099a38 DEV: Be sure to read the file into string before base64
Follow up to: 08b4753843917d62a2d4480052e1d590fdc45315

If you don't use `read` base64 will error out with: "no implicit
conversion of Tempfile into String"
2019-11-14 05:55:36 -07:00
08b4753843 DEV: Use FileHelper instead for downloading narrative bot avatar
Follow up to

b69450bee2

Using FileHelper here allows us to not have to use another require for
open-uri and gives us all the benefits of FileHelper.
2019-11-14 05:23:51 -07:00
0bb6b64747 DEV: Run prettier 2019-11-14 11:01:22 +00:00
7b63c92f47 DEV: Remove path building indirection
Tags are now handled just like other context information.
2019-11-14 10:47:14 +00:00
126b9bd16d FIX: Tag topic lists should pass on noSubcategories when building the top menu 2019-11-14 10:40:14 +00:00
a1cf0b88a8 DEV: Make NavItem.fromText take a filterType instead of a URL
This is step one of removing filterMode URLs entirely.
2019-11-14 09:43:15 +00:00
f434de2536 FIX: Tracking Topic State know about category_seen_at (#8351)
If category got last_seen_at is set TrackingTopicState should know about it and exclude those topics from marking them as new
2019-11-14 16:11:34 +11:00
b69450bee2 FIX: need to require open-uri for discourse-narrative-bot plugin
By requiring open-uri this will fix the following error:

```
NoMethodError (private method `open' called for #<URI::Generic...
```

also switched to the shorter syntax and removed default options. Since
ruby 2.4 redirect is on by default.
2019-11-13 18:11:50 -07:00
03efbad932 DEV: lint files 2019-11-14 11:52:29 +11:00
e7226a8c84 FEATURE: Allow scoping search to tag (#8345)
* When viewing a tag, the search widget will now show a checkbox to scope the search by tag, which will limit search results to that tag on desktop and mobile
2019-11-14 10:40:26 +10:00
6e1fe22a9d FEATURE: Dismiss new per category (#8330)
Ability to dismiss new topics per category.
2019-11-14 11:16:13 +11:00
d095c2cee7 FIX: Allow importing themes with subdirectories in extra_js
The folder/file detection was broken by 9fea43e46a7bb9ee1f8a3ce9d22bb41664f0852a. This commit fixes and adds relevant specs
2019-11-13 23:45:09 +00:00
0ba0aa00e7 DEV: Use a bigger suite for warming up the tmp folder 2019-11-13 18:34:10 -03:00
c63e84dc62 FEATURE: Send a message to new TL2 users and point them to the advanced tutorial (#8335)
* FEATURE: Send a message to new TL2 users and point them to the advanced tutorial

* DEV: Use a method to find the discobot user
2019-11-13 18:31:49 -03:00
a4b89f8187 DEV: Remove some extra Discourse.Site uses 2019-11-13 16:00:58 -05:00
bc2067898e FIX: Missing User objects in Utilities 2019-11-13 15:55:32 -05:00
f5ed0dc2e6 FIX: Failing tests 2019-11-13 15:34:30 -05:00
3d0b310368 DEV: Fix some more deprecated Discourse.User and Discourse.Site 2019-11-13 15:34:30 -05:00
4843414de6 WIP - set Discourse.currentUser 2019-11-13 15:34:30 -05:00
38cc1962e7 WIP - discourse/models/user not defined 2019-11-13 15:34:30 -05:00
f9894aec97 DEV: Remove Discourse.User and import instead 2019-11-13 15:34:30 -05:00
0a14b9b42a FEATURE: Automatically redirect to authenticator when there is only one
This brings the behavior in line with native Discourse SSO. If login is required, and a user tries to visit the forum, they will be directed straight to the external login page without requiring any clicks.
2019-11-13 17:28:12 +00:00
3c5df82590 DEV: Remove Discourse.Site in favor of import (#8344)
* DEV: Remove Discourse.Site in favor of importing Site

* Ran prettier
2019-11-13 12:13:47 -05:00
d2b3ac1282 FIX: Missing braces 2019-11-13 12:04:40 -05:00
f518065654 FIX: computed is part of @ember/object not @ember/object/computed 2019-11-13 11:58:09 -05:00
e98d94f17f DEV: Commas in top_menu items are no longer used
According to eviltrout, commas and pipes were the delimiters of a
Discourse specific microformat, but this is no longer the case and
hasn't been for some time.
2019-11-13 16:21:34 +00:00
481efebe76 DEV: Update backup/restore pipeline to avoid cd (#8347) 2019-11-13 15:52:28 +00:00
d2d846a88e DEV: prevents input/change events to cause a full rerender (#8339)
Code should decide when to do something with the event value, and maybe cause a re-rerender but it shouldn't be automatic. This is currently a gigantic waste of resources.
2019-11-13 15:49:01 +01:00
a7dd31496e DEV: Defer creation of extraNavItems until they are required
This also means that each list view gets a fresh set of ExtraNavItems.
2019-11-13 14:04:37 +00:00
e00ec22582 DEV: Remove extraneous intermediates 2019-11-13 14:03:47 +00:00
13c5381027 DEV: Don't return navigation item from addNavigationBarItem
No plugin or theme that I could find used the return value. Not
providing this to plugins affords us leeway to change the internals.
2019-11-13 13:07:09 +00:00
58b5d1434b FIX: Allow forceActive without a customHref 2019-11-13 12:17:57 +00:00
60e804ad5c DEV: No need to use call to call these callbacks
This is safe because addNavigationBarItem decorates these callbacks,
throwing away the context.
2019-11-13 11:50:40 +00:00
5ff84be8cc FIX: do not strip nil string 2019-11-13 16:58:14 +05:30
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
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