Commit Graph

23747 Commits

Author SHA1 Message Date
David Taylor e7bad9f05d
FIX: Ensure directory items appear in a consistent order (#11370)
User directory items are sorted by some activity metric. If those metrics have the same value, postgres does not guarantee the order in which they will be returned. This can cause issues in pagination - some users may appear twice, and some may be missed. To illustrate

```
pry(main)> query = DirectoryItem.where(period_type: DirectoryItem.period_types[:weekly]).order(:likes_received).limit(50);
pry(main)> page1 = query.offset(0).pluck(:id);
pry(main)> page2 = query.offset(50).pluck(:id);
pry(main)> (page1 & page2).count # users on both pages
=> 29
```

If we use the primary key to tie-break matching metrics, things are much more reliable

```
pry(main)> query = DirectoryItem.where(period_type: DirectoryItem.period_types[:weekly]).order(:likes_received, :id).limit(50);
pry(main)> page1 = query.offset(0).pluck(:id);
pry(main)> page2 = query.offset(50).pluck(:id);
pry(main)> (page1 & page2).count # users on both pages
=> 0
```

This most commonly effects new sites where all the directory metrics are zero.

The fact that the ordering is indeterminate makes it difficult to write a reliable test case for this.
2020-11-27 18:12:49 +00:00
Robin Ward 65eec147fc FEATURE: Add plugin js / plugin test js to bootstrap.json
This allows 3rd party clients (such as Ember CLI) to run plugins and
their tests.
2020-11-27 12:31:17 -05:00
Roman Rizzi 1c2358ba16
DEV: Tidy up imports. (#11364)
Only allow one import definition per file and add a new eslint rule to enforce it.
2020-11-27 11:30:16 -03:00
Gerhard Schlager 2e5e4dbf19
DEV: Make it easier to customize link attributes in quick access menu (#11365)
This allows themes to customize link attributes:

```
api.reopenWidget("quick-access-item", {
  _linkAttributes(href) {
    const attributes = this._super(...arguments);
    // do stuff
    return attributes;
  }
}
```
2020-11-27 12:26:47 +01:00
Bianca Nenciu eeae657ca5
FIX: No tags should be set if tag chooser is hidden (#11362)
If a user could not set tags because they had a trust level lower than
min_trust_level_to_tag_topics site setting, the "Create Topic" button
from a tag page would still show up and be enabled. Clicking it caused
the composer model to silently have the tags set.
2020-11-27 13:03:37 +02:00
Robin Ward dab2f2fdf4 REFACTOR: We can't use Ember.HTMLBars.compile in Ember CLI
Instead we use the inline `hbs` helper. Note in the non-Ember CLI
version this will not actually inline compile, but it will still work
for all our tests.
2020-11-26 09:27:20 -05:00
Joe eecff3d15b
DEV: Ensures mobile RTL stylesheets are loaded (#11360)
This PR only makes CSS changes that have no visual impact, but they fix an issue in the compiler that causes some stylesheets not to load on mobile RTL.

Full context here

https://meta.discourse.org/t/user-card-will-not-open-on-the-mobile/171268/6?u=johani
2020-11-26 21:03:25 +08:00
David Taylor f56c4b78da
FEATURE: Add users:log_out API key scope (#11359) 2020-11-26 10:39:38 +00:00
Sam 97eae4e3ad
PERF: avoid using destroy_all when removing stats (#11358)
destroy_all will load all the active record relation and iterate, this
can get extremely expensive.
2020-11-26 15:29:39 +10:00
Robin Ward 059e9cb1d2 REFACTOR: Remove `.erb` from emoji-picker
We can't use erb in ember-cli, and it seems the emoji groups rarely
change anyway. This commit migrates the ERB to pre-rendered javascript
that is updated via the `rake javascript:update_constants` task.
2020-11-25 11:23:02 -05:00
Joffrey JAFFEUX abb89475a3
FIX: issues with frowning/grinning (#11235)
- frowning was using slighty_frowning
- slightly_frowning was using frowning
- grinning_face_with_smiling_eyes was not defined
- fronwing_face_with_open_mouth was not defined
2020-11-25 09:09:35 +01:00
Martin Brennan 5028aaf446
FIX: Add secure media url to SERVER_SIDE_ONLY list (#11348) 2020-11-25 15:31:31 +11:00
Martin Brennan 2348a7972e
FIX: When quoting an attachment, keep the |attachment in markdown (#11347) 2020-11-25 15:31:14 +11:00
Sam 3e1b94c227
PERF: avoid checking card background and user background when not supplied (#11299)
Previously we were performing a bunch of needless work when SSO failed
to supply profile and card backgrounds.
2020-11-25 10:53:44 +11:00
jbrw 416f984c5e
FEATURE: Update onebox and add styling for githubfolder onebox (#11313) 2020-11-25 10:51:29 +11:00
Robin Ward 436d68d54f
UX: Don't show selected posts interface twice on mobile (#11328)
Note to reproduce you need a topic with over 3 posts.
2020-11-25 10:50:05 +11:00
Bianca Nenciu f9ff51870b
FIX: Rebake theme fields if upload changes (#11341)
Updating SVG sprites of a theme did not take effect immediately because
the cache was not cleared.
2020-11-25 10:49:12 +11:00
Rafael dos Santos Silva a6613d15f4
Adds discourse-gifs to suggested components (#11339) 2020-11-24 14:58:45 -03:00
Robin Ward 0e0c70019b FIX: Suggested Topics was being set inside a computed property
This is bad because changing the `suggested_topics` proeprty could cause
a `set` on `suggested_topics`.
2020-11-24 11:08:11 -05:00
Penar Musaraj 67979b2b21
Remove "Alternative Logos" from popular themes list (#11337)
Core has had support for dark theme logos for a while now.
2020-11-24 10:13:16 -05:00
David Taylor 0c685a46de
FEATURE: Add user update, anonymize and delete API scopes (#11335) 2020-11-24 12:54:24 +00:00
Dan Ungureanu 123107c28f
UX: Add group name to error message (#11333)
The group name used to be part of the error message, but was removed
in a past commit.
2020-11-24 13:06:52 +02:00
Dan Ungureanu 2742595b00
FIX: Checkbox value should not leak between themes (#11327)
This commit includes a hack to ensure didInsertElement is called only
once.
2020-11-24 12:10:28 +02:00
Penar Musaraj 4b538e7cb9
DEV: Skip missing icon warnings in production (#11334)
The list of SVG icons is unavailable in production, and the previous
refactor here was causing incorrect and noisy console warnings.

This also parses the `svgIconList` string in a dev environment, icons
should now match more accurately.
2020-11-23 21:41:54 -05:00
Jarek Radosz de2d323ccf
UX: Slightly adjust onebox alignment (#11326)
* fixed header/favicon's vertical alignment
* slightly increased header margin
* made the onebox padding symmetrical
* increased the right margin on small image elements
* removed extraneous pre bottom margin
2020-11-23 22:16:50 +01:00
Robin Ward 3394d994e9 FIX: Tests were using jQuery selectors
For the most part `querySelectorAll` will work with jQuery selectors,
but the big exception is `:eq(0)` and similar. Those needed to be
replaced.
2020-11-23 11:36:07 -05:00
Bianca Nenciu 60bc38e6a8
FIX: Gracefully handle force pushes for remote themes (#11325)
Force pushing a commit to a theme repository used to break the updater,
because the system was not able to count the commits behind the old and
new version. This operation failed because a force push deleted the old
commits.

The user was prompted with a simple "500 server error" message.
2020-11-23 15:29:22 +02:00
Vinoth Kannan 139c5dc356
FIX: use `tag` model instead of tagId property. (#11298)
In a recent commit 866fa008d4 support for tagId property is removed.

And added a test case. Follow-up for 2d5bb516a6.
2020-11-23 16:40:15 +05:30
David Taylor 20c0da8516
FIX: Improve email validation error handling for external logins (#11307)
- Display reason for validation error when logging in via an authenticator
- Fix email validation handling for 'Discourse SSO', and add a spec

Previously, validation errors (e.g. blocked or already-taken emails) would raise a generic error with no useful information.
2020-11-23 11:06:08 +00:00
Dan Ungureanu 4638c6fc8d
FEATURE: Add 'all subcategories' option in category-selector (#11099) 2020-11-23 10:55:32 +02:00
Kris 855026eea1
UX: PM title glyph alignment and consistency improvement (#11314)
* UX: PM title glyph alignment should match public topic-status style

* minor fixes
2020-11-23 12:16:41 +11:00
Jarek Radosz 790b9856af
FIX: Onebox image alignment (#11319)
It was overlapping with elements after it and was unnecessarily indented relative to the text before it.
2020-11-23 10:49:02 +11:00
David Taylor a9eb1163e1
UX: Do not include current user in group-filtered directory results (#11310)
At the moment, when filtering by group, the directory will unconditionally return the current user at the top of the list. This is quite unexpected, given that the user is deliberately trying to filter the list. This commit makes sure the 'include current user' logic only triggers for unfiltered directories
2020-11-23 10:22:14 +11:00
Robin Ward 66ecefba52 FIX: Upload events happened outside of the runloop
This could cause test failures when checking for the result of the
events if Ember hasn't applied them yet.
2020-11-20 15:35:00 -05:00
Joffrey JAFFEUX 8aa912c885
FIX: iconList is an array in production (#11308)
This should be investigated further, but hopefully the comment will prevent anyone else to fall in this trap.
2020-11-20 20:00:51 +01:00
Robin Ward 1ea6bbab34 FIX: We shouldn't debounce this in testing
Eventually we should add a helper to prevent all debouncing in test, but
for now this will really speed up Ember-CLI tests.
2020-11-20 12:39:49 -05:00
Robin Ward d6f2a63efe FIX: Tests were performing `data[]` queries but without quotes
This works in jQuery but not querySelectorAll
2020-11-20 12:39:07 -05:00
Joffrey JAFFEUX 8a90a5610f
DEV: allows to check if an icon is in the set (#11303) 2020-11-20 17:34:55 +01:00
Penar Musaraj 7539c2ed7f
UX: Revamp category security tab (#11273) 2020-11-20 10:44:34 -05:00
Jarek Radosz dbcf722ab9
DEV: Modulize component tests (#11300)
It's like the new tests, but still old underneath!
2020-11-20 15:54:09 +01:00
Arpit Jalan c244214fe5
UX: update "Rebuild-HTML" icon (#11296) 2020-11-19 19:39:18 -08:00
Robin Ward 1157ff8116 FIX: There are two elements with a `suspend-reason` class
We only want to fill in the text one. (This is an Ember CLI fix)
2020-11-19 14:16:35 -05:00
Dan Ungureanu 5202380a04
DEV: Move browser-update.js.erb out of vendored scripts (#11234)
This script has been adopted and modified.
2020-11-19 18:48:24 +02:00
Martin Brennan a6f700d4ef
FIX: Show better error if no bookmarks found from search (#11284)
See https://meta.discourse.org/t/no-results-for-bookmarks-search-confusing-message/169763
2020-11-19 09:10:28 +10:00
Gerhard Schlager 333f0af0ec
FIX: Cached badge_count isn't updated after backfilling badges (#11281) 2020-11-18 22:01:56 +01:00
Robin Ward 625cf5a8ae FIX: Modal methods should be wired up in `setupTests` not in module 2020-11-18 15:42:49 -05:00
jbrw 331236d6d7
Onebox improved error handling and support for Instagram Access Tokens (#11253)
* FEATURE: display error if Oneboxing fails due to HTTP error

- display warning if onebox URL is unresolvable
- display warning if attributes are missing

* FEATURE: Use new Instagram oEmbed endpoint if access token is configured

Instagram requires an Access Token to access their oEmbed endpoint. The requirements (from https://developers.facebook.com/docs/instagram/oembed/) are as follows:

- a Facebook Developer account, which you can create at developers.facebook.com
- a registered Facebook app
- the oEmbed Product added to the app
- an Access Token
- The Facebook app must be in Live Mode

The generated Access Token, once added to SiteSetting.facebook_app_access_token, will be passed to onebox. Onebox can then use this token to access the oEmbed endpoint to generate a onebox for Instagram.

* DEV: update user agent string

* DEV: don’t do HEAD requests against news.yahoo.com

* DEV: Bump onebox version from 2.1.5 to 2.1.6

* DEV: Avoid re-reading templates

* DEV: Tweaks to onebox mustache templates

* DEV: simplified error message for missing onebox data

* Apply suggestions from code review
Co-authored-by: Gerhard Schlager <mail@gerhard-schlager.at>
2020-11-18 12:55:16 -05:00
jbrw 8e8dca9246
FIX: Selected Tag Group permission shouldn’t change during save (#11274)
`setPermissionsGroups` would initialize an empty permissions object whenever new groups were added to the Tag Group. This meant that if you selected the `visible` permission and then added groups to the Tag Group, the `visible` permission would be obliterated and the Tag Group would be treated as though it was `private`.
2020-11-18 11:22:19 -05:00
Penar Musaraj d90b852cd0
UX: bottom padding for menu panel on iOS notch devices (#11270) 2020-11-17 15:42:03 -05:00
Robin Ward 75e92e1bd7 REFACTOR: The Favcount library needs global variables
This moves the library into our lib folder, and refactored it to more
modern Javascript. I've kept the MIT license at the top of the file.

Doing this allows us to import it as a library in Ember CLI and ditch
yet another global variable.
2020-11-17 15:04:17 -05:00