Commit Graph

18229 Commits

Author SHA1 Message Date
Kris 28ddaf80d2 Adding max-width to category logos 2018-12-04 13:01:27 -05:00
Régis Hanol 3c9c95ac83 Update Rubocop to 0.60 2018-12-04 10:48:16 +01:00
Joe 72bd388ff7
UX: truncate long topic tiles to prevent badges and date from wrapping 2018-12-04 15:27:23 +08:00
Sam aa97f6fdba FEATURE: disable notifications for small actions that are whispers
Previously we would notify on small actions if they were whispers
this inconsistently lead to all sorts of problems including

- collapsed "N replies" after assign
- empty push notifications

New behavior adds an api to explicitly send push notifications as well
if needed: create_notification_alert
2018-12-04 17:54:42 +11:00
Sam 5c17e46274 FEATURE: allow advanced specification of excerpts for posts
Previously users could control excerpt with `<span class='excerpt'>`
in Markdown, this is somewhat limited for plugins that need to define this
across a section. This adds support for DIV as well
2018-12-04 15:13:34 +11:00
David Taylor 9248ad1905 DEV: Enable `Style/SingleLineMethods` and `Style/Semicolon` in Rubocop (#6717) 2018-12-04 11:48:13 +08:00
Penar Musaraj 56948896ff UX: replace FA5 compress/expand icons
Adds a new SVG sprite file that contains non-FontAwesome 5 icons to our subset.

Adds the FontAwesome 4.7.0 icons for expand / collapse.
2018-12-03 22:29:20 -05:00
Penar Musaraj 923692d45a FIX: tooltip regression in admin dashboard
- adds registerHoverTooltip in tooltip qunit test
2018-12-03 11:15:31 -05:00
Penar Musaraj f8e6a37858 FIX: raise exception when getting dimensions of missing image
- follow-up on 0eacd45ab1
2018-12-03 10:19:49 -05:00
Maja Komel 142361d6da FIX: don't steal focus when text in editor is replaced (#6712) 2018-12-03 09:49:17 +01:00
Guo Xiang Tan 125bb46052 Remove unused constant in the codebase. 2018-12-03 11:04:47 +08:00
Sam cc04c86859 UX: do not restrict width of category image, only height
This was a recent visual regression which caused a fair amount of pain.
Previously we only restricted height
2018-12-03 09:35:16 +11:00
Sam 236c755d62 FIX: do not store key tracking last seen time indefinitely
UserStat has some special logic to keep adding time read if repeat calls
are made in intervals less than 100 seconds. This is called regularly
when we update read timings on a topic.

We only need to cache this key in redis for 100 seconds, however previously
we would keep it forever, 1 key per user. This has potential of bloating
a very large amount of keys for no longer active users in redis.
2018-12-03 08:35:26 +11:00
Kris 26e9b628b8 post-infos alignment fix 2018-11-30 21:31:36 -05:00
Kris a113777003 Extra margin isn't needed on mobile 2018-11-30 19:49:26 -05:00
Penar Musaraj bbd33de05b FIX: lightbox expand icon on mobile 2018-11-30 14:35:45 -05:00
Kyle Zhao 488fba3c5f
FEATURE: allow plugins and themes to extend the default CSP (#6704)
* FEATURE: allow plugins and themes to extend the default CSP

For plugins:

```
extend_content_security_policy(
  script_src: ['https://domain.com/script.js', 'https://your-cdn.com/'],
  style_src: ['https://domain.com/style.css']
)
```

For themes and components:

```
extend_content_security_policy:
  type: list
  default: "script_src:https://domain.com/|style_src:https://domain.com"
```

* clear CSP base url before each test

we have a test that stubs `Rails.env.development?` to true

* Only allow extending directives that core includes, for now
2018-11-30 09:51:45 -05:00
Penar Musaraj 7dec963f2e FIX: add vkontakte icon alias 2018-11-30 08:50:38 -05:00
David Taylor 208005f9c9 REFACTOR: Migrate FacebookAuthenticator to use ManagedAuthenticator
Changes to functionality
  - Removed syncing of user metadata including gender, location etc.
    These are no longer available to standard Facebook applications.
  - Removed the remote 'revoke' functionality. No other providers have
    it, and it does not appear to be standard practice in other apps.
  - The 'facebook_no_email' event is no longer logged. The system can
    cope fine with a missing email address.

Data is migrated to the new user_associated_accounts table.
facebook_user_infos can be dropped once we are confident the data has
been migrated successfully.
2018-11-30 11:18:11 +00:00
David Taylor 534e1b1b18 DEV: Introduce Auth::ManagedAuthenticator
A generic implementation of Auth::Authenticator which stores data in the
new UserAssociatedAccount model. This should help significantly reduce the duplicated
logic across different auth providers.
2018-11-30 11:18:11 +00:00
Arpit Jalan 059e36a6ff FIX: log name changes only when the name is actually updated 2018-11-30 15:30:46 +05:30
Guo Xiang Tan eecd1a7d8c FIX: `Jobs::CleanUpUploads` fails when value of upload data_type is an empty string. 2018-11-30 10:46:39 +08:00
Penar Musaraj 0eacd45ab1 FIX: refactor ImageSizer.resize
reverts 140d9c2
2018-11-29 15:28:45 -05:00
Penar Musaraj 140d9c2910 FIX: call ImageSizer only if width/height are available 2018-11-29 15:03:02 -05:00
Arpit Jalan 40f10855c6
FIX: defer flags (only) when handling a flag and deleting replies (#6702) 2018-11-29 22:44:18 +05:30
Maja Komel 4a8f21d387 FIX: prevent minimum_required_tags on category being set to null (#6703)
* FIX: prevent minimum_required_tags on category being set to null

* add migration for NOT_NULL constraint for minimum_required_tags

* add specs
2018-11-29 18:10:14 +01:00
Penar Musaraj 5b6c1b1670 SCSS refactoring
followup on c388cac
2018-11-29 12:02:11 -05:00
Joffrey JAFFEUX 4f24d7dec8
FIX: more resilient whisper state between composer states (#6687) 2018-11-29 16:16:34 +01:00
Joffrey JAFFEUX 8da8f5d0f7
FIX: call onSelect plugin callbacks for noop rows (#6682) 2018-11-29 15:56:19 +01:00
Joffrey JAFFEUX 4c7dfed32e
FIX: error with tags enabled and no tags created (#6701) 2018-11-29 10:39:09 +01:00
Guo Xiang Tan ffdacba219 Remove extra `apple-touch-icon` link in head.
The sizes attribute does not make a difference because both
image provided is of the same size.
2018-11-29 15:24:52 +08:00
Vinoth Kannan 5db50d6cdc UX: Use aspect ratio to calculate width and height precisely
Followup on 1da265d
2018-11-29 09:32:03 +05:30
Penar Musaraj c388cacb81 UX: Style group flair in /groups same as in topic avatars 2018-11-28 16:02:49 -05:00
Penar Musaraj 6568832235 FIX: map discord/patreon FA5 icons for login buttons correctly 2018-11-28 14:36:36 -05:00
Kris 6027e7ba3d FIX: Restrict logo width for small screens 2018-11-28 13:27:56 -05:00
Saurabh Patel 55945ec7c8 FIX: throw error when link in reason for grant badge is an external link (#6690) 2018-11-28 18:01:41 +01:00
Gerhard Schlager e7b76b319a FEATURE: Setting for short title used by Android on homescreen 2018-11-28 14:59:30 +01:00
Saurabh Patel 49c3cf9c75 UX: Topic stats were hard to translate 2018-11-28 14:25:22 +01:00
Arpit Jalan 851ef14096 Revert "FIX: do not agree flags by default when deleting posts"
This reverts commit cb6fc8057b.
2018-11-28 10:21:11 +05:30
Arpit Jalan 654d7996ae FIX: title was repeating on about page 2018-11-28 08:06:14 +05:30
Sam 912a7105d2 DEV: polyfill Object.values and use where needed
We now have polyfills for `values` IE and `entries` IE

This commit uses values where appropriate to eliminate an extra lookup
This simplifies the code a bit.

Followup to: 7f089f07a7
2018-11-28 10:07:05 +11:00
Sam 3cb88bc566 DEV: Run file through prettier
We only alert on .js.es6 this is a js file so it is bypassed
2018-11-28 10:03:54 +11:00
Arpit Jalan bdb1268528 FIX: static page title should be consistent on client side and server side 2018-11-27 22:03:52 +05:30
Joffrey JAFFEUX 7f089f07a7
FIX: better fix for #ca84c06 (#6684) 2018-11-27 16:12:07 +01:00
David Taylor f993aca363 FIX: Fix editing built-in badges after removing `_.include`
We want to send the unprotected fields to the server. Corrects 4c8cfe0f
2018-11-27 15:01:02 +00:00
Joffrey JAFFEUX ca84c06c59
FIX: revert to using _.each (#6683)
Should be replaced with Object.keys variation when reproducible
2018-11-27 15:55:56 +01:00
Kris 964fd983b7 z-index fix for tooltips within posts 2018-11-27 09:49:34 -05:00
Maja Komel a2bff038e8 FIX: set overridden param for customize site text query only when checkbox value changes 2018-11-27 14:29:48 +01:00
Maja Komel a0fca2b6ed FIX: popular posts font weight in summary email 2018-11-27 12:58:28 +01:00
Gerhard Schlager 886ef7251d REFACTOR: Simplify extraction of mentions 2018-11-27 12:46:02 +01:00
Guo Xiang Tan c92c56d986 FIX: Randomly failing QUnit test.
The `post` variable can be an actual post object or a `new Placeholder("post-placeholder")` which does not define the function `get`.

* QUNIT_SEED=11414431645131211212599424733847938795
2018-11-27 16:00:46 +08:00
Guo Xiang Tan a1e77aa2ed
FEATURE: Reimplement `SiteSetting.max_oneboxes_per_post`. (#6668)
Previously, the site setting was only effective on the client side of
things. Once the site setting was been reached, all oneboxes are not
rendered. This commit changes it such that the site setting is respected
both on the client and server side. The first N oneboxes are rendered and
once the limit has been reached, subsequent oneboxes will not be
rendered.
2018-11-27 16:00:31 +08:00
Arpit Jalan 6cb49cd42c
Merge pull request #6671 from techAPJ/destroy-posts-flags
FIX: do not agree flags by default when deleting posts
2018-11-27 11:27:23 +05:30
Arpit Jalan cb6fc8057b FIX: do not agree flags by default when deleting posts 2018-11-27 10:57:20 +05:30
Dan Ungureanu 38e29d8c94 DEV: Fix coding style. 2018-11-27 13:05:27 +11:00
Dan Ungureanu d657ce844b DEV: Call onClose for closing modals. 2018-11-27 13:05:27 +11:00
Dan Ungureanu 0005bded6c DEV: Added composer-action-after plugin outlet. 2018-11-27 13:05:27 +11:00
Dan Ungureanu 1f9f00a629 DEV: Add data-topic-id to more elements containing titles. 2018-11-27 13:05:27 +11:00
Dan Ungureanu 8837fe47d7 DEV: Add app event triggered when composer's reply is reloaded. 2018-11-27 13:05:27 +11:00
Dan Ungureanu b65e5d263e DEV: Add a plugin outlet for top-side notices. 2018-11-27 13:05:27 +11:00
Vinoth Kannan 1da265db11 UX: category images have no sizes (#6662) 2018-11-27 08:40:06 +08:00
Penar Musaraj 03deda2147
Upgrade to FontAwesome 5 (take two) (#6673)
* Add missing icons to set

* Revert FA5 revert

 This reverts commit 42572ff

* use new SVG syntax in locales

* Noscript page changes (remove login button, center "powered by" footer text)

* Cast wider net for SVG icons in settings

- include any _icon setting for SVG registry (offers better support for plugin settings)

- let themes store multiple pipe-delimited icons in a setting

- also replaces broken onebox image icon with SVG reference in cooked post processor

* interpolate icons in locales

* Fix composer whisper icon alignment

* Add support for stacked icons

* SECURITY: enforce hostname to match discourse hostname

This ensures that the hostname rails uses for various helpers always matches
the Discourse hostname

* load SVG sprite with pre-initializers

* FIX: enable caching on SVG sprites

* PERF: use JSONP for SVG sprites so they are served from CDN

This avoids needing to deal with CORS for loading of the SVG

Note, added the svg- prefix to the filename so we can quickly tell in
dev tools what the file is

* Add missing SVG sprite JSONP script to CSP

* Upgrade to FA 5.5.0

* Add support for all FA4.7 icons

- adds complete frontend and backend for renamed FA4.7 icons

- improves performance of SvgSprite.bundle and SvgSprite.all_icons

* Fix group avatar flair preview

- adds an endpoint at /svg-sprites/search/:keyword

- adds frontend ajax call that pulls icon in avatar flair preview even when it is not in subset

* Remove FA 4.7 font files
2018-11-26 16:49:57 -05:00
Joffrey JAFFEUX 818761c3a4
FIX: uses appropriate z-index for tooltips (#6674) 2018-11-26 22:47:12 +01:00
Gerhard Schlager 5640166b27 FIX: Notify only invited users about mentions in PMs 2018-11-26 22:42:56 +01:00
Kris 593cd831e1 Wrap long lists of admin tabs on large screens 2018-11-26 14:51:45 -05:00
Robin Ward 8bca2647ea FIX: Upwards scrolling occasionally broken
This fixes a bug in Chrome where upwards scrolling would occasionally
not work properly.
2018-11-26 13:37:12 -05:00
Penar Musaraj 2e4706b787 FIX: bug and typo in admin user badges 2018-11-26 10:24:46 -05:00
Joffrey JAFFEUX 3453707784
FEATURE: allows html tooltips (#6665) 2018-11-26 11:15:23 +01:00
Joffrey JAFFEUX e47b478b83
DEV: removes _.toArray from codebase (#6654) 2018-11-26 11:15:05 +01:00
Guo Xiang Tan 0972516abe FIX: Incorrect "rel" used for apple icons in `<head>`.
Nothing on the web I can find suggests that this should have been `rel=icon`.
See https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
2018-11-26 10:40:09 +08:00
Guo Xiang Tan d4aaa968bb Fix linting. 2018-11-26 09:38:22 +08:00
Guo Xiang Tan 57e2f4990d
PERF: Move processing of inline onebox out of V8 context. (#6658) 2018-11-26 09:21:38 +08:00
Penar Musaraj 93d4281706 FIX: alignment issue in PM inbox when bulk selecting 2018-11-25 15:24:26 -05:00
Arpit Jalan b5bf182ad5 FIX: validate topic deletion when acting on a flag 2018-11-25 23:24:03 +05:30
Bianca Nenciu 172b3bf4d3 FIX: Fix broken theme field URLs. (#6622) 2018-11-23 16:11:05 +01:00
Joe 336436dfb4
UX: better handling of logo size 2018-11-23 22:04:42 +08:00
Joe e2214b50f3
UX: add height attribute to logo on error pages
This matches what we do in the home-logo widget. The height is set as an attribute and we use CSS to get a scaled width that preserves the aspect ratio of the image.
2018-11-23 15:04:34 +08:00
Guo Xiang Tan a1888b301b DEV: Don't require login for QUit test path. 2018-11-23 13:50:19 +08:00
Joe 98354bd34c
fix the build 2018-11-23 11:27:59 +08:00
Joe c4fca36255
FIX: don't trigger header:hide-topic at the bottom on desktops
On mobile we trigger `header:hide-topic` at the very bottom of topics to switch the header contents back from small logo + topic info to large logo + user panels. 

Given that the `topic-progress` component is sometimes loaded on desktop - E.g composer is open or on narrow desktop screens - we need a guard to prevent this logic from firing on desktops.
2018-11-23 10:14:13 +08:00
Joffrey JAFFEUX f4432648fd
FIX: categories/delete_categories can be undefined (#6657) 2018-11-23 00:57:18 +01:00
David Taylor f645cb9c14
FEATURE: Use translated name for 'your email has been authenticated by' (#6649) 2018-11-22 19:12:04 +00:00
Joffrey JAFFEUX 7e20a0b917
DEV: removes _.indexOf from codebase (#6652) 2018-11-22 17:38:58 +01:00
David Taylor 0083eec686 FEATURE: Allow logo URLs to be overridden easily using `reopenWidget()` 2018-11-22 16:29:12 +00:00
Joffrey JAFFEUX 56478166e5
FIX: broken badge groupings modal UI (#6653) 2018-11-22 17:09:45 +01:00
Joffrey JAFFEUX 2843944315
FIX: better alignment of badge selector and edit btn (#6651)
Input located at /admin/badges/new
2018-11-22 16:21:15 +01:00
Joffrey JAFFEUX e77cc44f07
FIX: better alignment of groups header filters (#6650)
This is located at the top of the /groups page.
2018-11-22 16:18:02 +01:00
Kyle Zhao 80398d0b8f
Extract inline JS on embedded comments (#6645)
* use the meta refresh tag instead

* extract inline JS in embedded comment
2018-11-22 10:02:58 -05:00
David Taylor 1fd0787dd7 UX: Ensure unstyled `.btn-social` elements have a contrasting background
For example, in plugins where the background color is not explicitly set
2018-11-22 15:00:32 +00:00
Gerhard Schlager 2ef16e9f4e FIX: Failed to delete post belonging to non-existent topic 2018-11-22 15:08:37 +01:00
Arpit Jalan 60941f214c FIX: remove unneeded keys from failed response 2018-11-22 14:59:50 +05:30
Guo Xiang Tan 3f636b2d19 FIX: Check whether group is mentionable by user when cooking post. 2018-11-22 16:16:33 +08:00
Vinoth Kannan 036790d13c FIX: Assign default value for category.findByIds method 2018-11-22 12:51:04 +05:30
Guo Xiang Tan 6111b285d9 DEV: Remove comment that links to a private topic.
Not going to be useful for other developers.
2018-11-22 14:55:02 +08:00
Guo Xiang Tan c5a70eca6e
PERF: Move mention lookups out of the V8 context. (#6640)
We were looking up each mention one by one without any form of caching and that results
in a problem somewhat similar to an N+1. When we have to do alot of DB
lookups, it also increased the time spent in the V8 context which may
eventually lead to a timeout. The change here makes it such that mention lookups only does a single
DB query per post that happens outside of the V8 context.
2018-11-22 14:28:48 +08:00
Guo Xiang Tan ba280f9cf3 FIX: Give up migrating url site setting if endpoint doesn't return data. 2018-11-22 12:16:52 +08:00
Guo Xiang Tan a8603e04ab FIX: Give up migration of URL site settings if there is an SSL error. 2018-11-22 12:14:27 +08:00
Kyle Zhao 8e32aa1483 FEATURE: show post approvals in Moderation History (#6643) 2018-11-22 10:22:23 +08:00
Joe ee6c0170ce FEATURE: Scroll-based logo on mobile (#6632) 2018-11-21 21:21:49 -05:00
Saurabh Patel d984323e23 FEATURE: Show change name of user in staff logs (#6647)
https://meta.discourse.org/t/admins-changing-users-name-not-username-should-be-logged/99511
2018-11-22 10:13:02 +08:00