Commit Graph

18304 Commits

Author SHA1 Message Date
Kyle Zhao
92df7b212c rename visible to visibleSiteSettings 2018-12-13 13:00:13 +11:00
Kyle Zhao
c9279a118e FIX: always show filtered site settings 2018-12-13 13:00:13 +11:00
Neil Lalonde
3b76f19668 FIX: invalidating inactive admin emails should mark them as not active 2018-12-12 17:07:49 -05:00
Neil Lalonde
a1db15fead FEATURE: require admins to re-validate their email addresses if they haven't been seen for a number of days, configurable with the invalidate_inactive_admin_email_after_days site setting. Social logins are also revoked. Default is 365 days. 2018-12-12 15:32:38 -05:00
Maja Komel
dbbadb5c35 FEATURE: add short_site_description setting to be included in title tag on homepage 2018-12-12 11:46:58 +01:00
Joffrey JAFFEUX
793f1274d1
FIX: makes charts more resilient to resizing (#6758) 2018-12-12 11:11:56 +01:00
Joffrey JAFFEUX
3a799ed922
FEATURE: Check if draft exists before starting a new one (#6755)
Co-Authored-By: Bianca Nenciu <nbianca@users.noreply.github.com>
Co-Authored-By: zogstrip <regis@hanol.fr>
2018-12-12 10:21:51 +01:00
Sam
0ca61242b8 FEATURE: polyfill intersection observer for IE11 / iOS Safari
This feature is used for defer loading of images and in future for post cloaking

This gives us a polyfill so we can safely use the feature in problem browsers

The polyfill supports "polling" but it does not appear we need it yet.

If we discover anything odd here, consider setting poll interval per:

https://github.com/w3c/IntersectionObserver/tree/master/polyfill

```
var io = new IntersectionObserver(callback);
io.POLL_INTERVAL = 100; // Time in milliseconds.
```

Keeping the mutation observer cause we often mutate the DOM
2018-12-12 15:36:08 +11:00
Kris
6d353a1e47 Alignment & spacing fix for quote controls 2018-12-11 21:17:31 -05:00
Guo Xiang Tan
86926f4aee DEV: Let create! handle the check for persistence.
This is unlikely to fail but we want to know when it does.
2018-12-12 08:36:13 +08:00
Robin Ward
6797a710aa FEATURE: Lazily Load Images as they scroll into the viewport.
This feature uses the Intersection Observer API

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

It should be compatible with all modern browsers. Non-Edge IE is *NOT*
supported, so in that particular browser images are loaded by default.
2018-12-12 10:12:49 +11:00
Jeff Wong
5358f25fc6 FIX: Support RTL languages in header menu 2018-12-11 10:33:56 -08:00
Jeff Wong
d2569f8e77 make linter happy 2018-12-11 09:41:40 -08:00
David Taylor
0f734e2ae2 FIX: Return authenticated=true when reconnecting
This prevents a registration popup on the client
2018-12-11 17:40:02 +00:00
Jeff Wong
71d8807fec
Full height swipe-able menus (#6566)
* Feature: Full height swipe enabled menus

support pan events on iphone
2018-12-11 09:15:20 -08:00
Gerhard Schlager
688755baf2 DEV: Improve specs and handle invalid email token
Follow-up to 7977b09025
2018-12-11 18:04:10 +01:00
Kris
8c227715ae $primary-high contrast reduction for dark themes 2018-12-11 10:08:00 -05:00
Kris
4cc0a3503b Adding space between badges for medium-sized viewports 2018-12-11 09:45:49 -05:00
David Taylor
c7c56af397
FEATURE: Allow connecting associated accounts when two-factor is enabled (#6754)
Previously the 'reconnect' process was a bit magic - IF you were already logged into discourse, and followed the auth flow, your account would be reconnected and you would be 'logged in again'.

Now, we explicitly check for a reconnect=true parameter when the flow is started, store it in the session, and then only follow the reconnect logic if that variable is present. Setting this parameter also skips the 'logged in again' step, which means reconnect now works with 2fa enabled.
2018-12-11 13:19:00 +00:00
Maja Komel
2ee2e5c981 UX: fix cropped image thumbnails 2018-12-11 12:23:39 +01:00
David Taylor
3fedb2ad20 DEV: Style and performance improvements
Follow-up from 9db8291
2018-12-11 09:58:20 +00:00
Sam
671469bcc7 FIX: URLs containing two # would fail to work
Some URLs in browsers are non compliant and contain twos `#` this commit adds
special handling for this edge case by auto encoding any fragments containing `#`
2018-12-11 18:03:13 +11:00
Sam Saffron
bb4ef644bf UX: reduce show dismiss.. at top of unread/new to 15
Previously we would require 30 unread or new topic to show the button at the top.
2018-12-11 14:11:54 +11:00
Gerhard Schlager
7977b09025 FEATURE: Activate users invited via email when invite is redeemed
Do not send an activation email to users invited via email. They
already confirmed their email address by clicking the invite link.
Users invited via link will need to confirm their email address before
they can login.
2018-12-11 00:09:53 +01:00
Kris
73d2fc194d UX: More consistent category lock and topic-status styles 2018-12-10 16:06:26 -05:00
David Taylor
071bd15463 FIX: Redirect to default homepage when visiting /login
Previously this was hard-coded to redirect to `/latest`
2018-12-10 15:39:05 +00:00
Maja Komel
ef7f84b59b Add groups to current user serializer (#6748) 2018-12-10 16:23:29 +01:00
David Taylor
9db829134c
FIX: Use database to persist metadata during social registration (#6750)
Previously was using the cookie_store, which is limited to 4kb. This caused issues for providers sending large volumes of metadata about a user.
2018-12-10 15:10:06 +00:00
Joffrey JAFFEUX
e06a8980fb
FIX: category-drop initial state was incorrect (#6743) 2018-12-10 14:05:00 +01:00
Penar Musaraj
7f361a546e UX: Add styling for updated twitter status icons in onebox
Minor adjustments needed by onebox version 1.8.69
2018-12-09 21:58:02 -05:00
Kris
c84b837d50 category badge alignment fix 2018-12-08 22:33:11 -05:00
Gerhard Schlager
0f41770547 Make Danger happy by running prettier 2018-12-08 02:59:09 +01:00
Kris
050c02228e UX: Globally dim categories slightly 2018-12-07 20:01:38 -05:00
Penar Musaraj
67450ba402 UX: when composer is minimized, let user open composer in regular size instead of full screen 2018-12-07 17:45:13 -05:00
Jeff Wong
ccd80a8b14 update png assets for push notification images 2018-12-07 14:00:39 -08:00
Kris
b26d0f20cc Fixing slight misalignment of login/signup buttons 2018-12-07 13:56:54 -05:00
Kris
d16a4b895f only dim categories, not all topic stats per 547eaa6 2018-12-07 13:35:57 -05:00
Kris
98c18f8349 button and alignment fixes for mobile user page 2018-12-07 12:34:37 -05:00
Kris
547eaa6060 UX: Dim visited post info along with title 2018-12-07 11:09:56 -05:00
Rafael dos Santos Silva
efec2db859 FEATURE: Web Share Target Support
This adds a **very basic** support for share to Discourse.

Currently, this is only supported in Android + Chrome 71+.

After installing a Discourse site to the Home Screen, you will be
able to share from anywhere in the OS to the Discourse site.

Discourse will use the title and text from the share event.
2018-12-07 13:48:09 -02:00
David Taylor
160d29b18a
REFACTOR: Migrate TwitterAuthenticator to use ManagedAuthenticator (#6739)
No changes to functionality. TwitterAuthenticator goes from 136 lines to 24, and all twitter-specific logic elsewhere has been deleted 🎉
2018-12-07 15:39:06 +00:00
Saurabh Patel
9e3143445b DEV:add uploaded_meta option in category for category meta image (#6724) 2018-12-07 16:24:07 +01:00
David Taylor
f7ce607e5d
FIX: Return 422 instead of 500 for invalid SSO signature (#6738) 2018-12-07 15:01:44 +00:00
David Taylor
5e09398c5b
FIX: Do not serialize user fields unless they are specified for display (#6736) 2018-12-07 10:57:28 +00:00
Sam
8e307e633e FIX: posts would not auto rebake unless gravatar download was enabled 2018-12-07 17:03:22 +11:00
Kris
031c252cd3 Slight alignment follow-up to db32d29 2018-12-06 20:01:38 -05:00
Kris
db32d29eaa UX: Refactoring topic statuses for consistent icon sizes & colors 2018-12-06 19:22:04 -05:00
Penar Musaraj
06d1b19ca2 FIX: Refactor lightbox mobile icon
- Fixes a performance issue on a site with lots of images in posts

- turns out that "filter: invert(100%)" performs very poorly on Safari/iPhone

- also disables transition on the element on mobile
2018-12-06 15:32:26 -05:00
Kris
b54b4d05c5 UX: improve code highlighting diffs for dark themes 2018-12-06 10:54:30 -05:00
Gerhard Schlager
4300ac0f4a UX: Show smaller Emojis within some HTML elements 2018-12-06 15:13:16 +01:00
Xiao Guan
7ec124fc89 FEATURE: Improved deprecation warnings (#6722)
* FEATURE: Discourse.deprecate can report version

* Ember counterpart for deprecation
2018-12-06 11:38:01 +00:00
Maja Komel
1d649e147b FEATURE: show avatar flair on group, badges and directory pages (#6732) 2018-12-06 12:18:52 +01:00
Gerhard Schlager
43cfdb1cb9 FIX: Wizard tries harder to find existing Welcome Topic
The wizard searches for:

* a topic that with the "is_welcome_topic" custom field
* a topic with the correct slug for the current default locale
* a topic with the correct slug for the English locale
* the oldest globally pinned topic

It gives up if it didn't find any of the above.
2018-12-06 10:27:22 +01:00
Guo Xiang Tan
27c793a192 FIX: `UserNotificationsHelper#logo_url' to work with S3 based uploads.
https://meta.discourse.org/t/digest-logo-not-working/103255
2018-12-06 09:39:08 +08:00
Guo Xiang Tan
dcf9c6da59 DEV: Don't publish post messages to non-human users. 2018-12-06 08:24:13 +08:00
Kris
a88f931d6f UX: Moving categories under topic title in topic list, removing category column (#6731)
* Starting to remove category column from topic list

* stacked nav alignment adjustment

* Revert "stacked nav alignment adjustment"

This reverts commit 98800c7058.

* remove comment

* removing function
2018-12-05 16:12:26 -08:00
Bianca Nenciu
a8e8473ea5 DEV: Apply code review. 2018-12-05 21:58:55 +01:00
Bianca Nenciu
79d987e483 FEATURE: Show autocomplete when enable_inline_emoji_translation is true. 2018-12-05 21:58:55 +01:00
Bianca Nenciu
e9bbdef156 FEATURE: Add support for inline emoji translation. 2018-12-05 21:58:55 +01:00
Bianca Nenciu
0c88052641 UX: Wrap pre element. 2018-12-05 21:56:18 +01:00
Bianca Nenciu
b585f7f336 DEV: Apply code review. 2018-12-05 21:56:18 +01:00
Bianca Nenciu
56890efd7a FEATURE: Add 'Advanced Test' for admin panel. 2018-12-05 21:56:18 +01:00
Bianca Nenciu
1a4f592749 FIX: Always allow admins upload selectable avatars. 2018-12-05 21:55:23 +01:00
Régis Hanol
aea2d8bbeb FIX: properly secure poll message bus
Co-authored-by: Sam <sam.saffron@gmail.com>
2018-12-05 21:27:49 +01:00
David Taylor
8aff99761a FIX: Ignore query parameters when displaying counter on internal links
This matches the server-side behaviour, so that the links display counters correctly
2018-12-05 18:29:54 +00:00
David Taylor
a1d9aeda8b REFACTOR: split TopicLink#extract_from into multiple methods
Also rename some confusing variables
2018-12-05 18:54:30 +01:00
David Taylor
37249c9a32 FIX: Do not reset link counts when post is rebaked
This was an indentation mistake introduced in 44eba0b. Pretty understandable, considering we are indented 8 levels deep in this method. Will follow-up with a refactor to improve this.
2018-12-05 18:54:30 +01:00
Guo Xiang Tan
978f0db109 SECURITY: Require groups to be given when inviting to a restricted category. (#6715) 2018-12-05 16:43:07 +01:00
Vinoth Kannan
57ba4b7cb2
DEV: remove unnecessary safe nav operators (#6730) 2018-12-05 20:07:18 +05:30
Kyle Zhao
97e6e3b133 DEV: duplicate and unreachable code after return 2018-12-05 09:17:20 -05:00
Vinoth Kannan
fb78414229 Add missing safe navigation operator 2018-12-05 16:23:43 +05:30
Vinoth Kannan
d33d031742
FEATURE: Filter topic and post web hook events by tags (#6726)
* FEATURE: Filter topic and post web hook events by tags

* Add a spec test with unmatched tags
2018-12-05 14:44:06 +05:30
Sam
82e45f5485 FIX: method extraction caused push notifications to include incorrect post
Previously the push notification code path was not tested for notification
collapsing. This happens if you get multiple replies to a topic you are
watching.
2018-12-05 16:40:10 +11:00
Vinoth Kannan
ec26a59eac FIX: variable name typo in subcategory image 2018-12-05 10:41:06 +05:30
Kris
e0aac75607 Restrict width of category heading to prevent mobile overflow 2018-12-04 19:01:27 -05:00
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