Commit Graph

22291 Commits

Author SHA1 Message Date
Joshua Rosenfeld c94e6a9a66
FEATURE: add noindex header to tags pages (#9748) 2020-05-12 10:44:46 -04:00
Mark VanLandingham 9bce91f59f
DEV: Allow plugins to add extra icons to category-link (#9743) 2020-05-12 09:41:16 -05:00
Bianca Nenciu 16137308b0
FIX: Show Settings button if plugin has settings (#9728)
It used to check if the plugin has an enabled_setting.
2020-05-12 11:18:19 +03:00
Sam Saffron a29ae17d3a
FIX: saving drafts unconditionally increases sequence
Previously we only changed sequence on ownership change, this
cause a race condition between tabs where user could type for a
long time without being warned of an out of date draft.

This change is a radical change and we should watch closely.

Code was already in place to track sequence on the client so no
changes are needed there.
2020-05-12 16:55:42 +10:00
Sam Saffron 451e9c4bb9
DEV: minor SQL formatting change
Moved join prior to left join to make query less confusing.

Has no material impact on performance.
2020-05-12 16:55:42 +10:00
Guo Xiang Tan 8fb99f218d
FEATURE: Allow plugins to register a callback to ignore DraftSequence. 2020-05-12 14:25:20 +08:00
Guo Xiang Tan d301af39bd
PERF: Avoid hitting DB when fetching draft sequence of bot user. 2020-05-12 13:56:58 +08:00
Martin Brennan 39a2d90e0f
DEV: Pass currentUser to post-menu button builders (#9752)
Adding this from a review; I was using Discourse.currentUser which is frowned upon now.

Passing currentUser both for regular post menu buttons and extra buttons attached via the plugin API.

Lots of formatting/whitespace changes, best off reviewing with ?w=1
2020-05-12 14:09:38 +10:00
Kris a009ec597d remove ember container div 2020-05-11 21:12:33 -04:00
tshenry 6f228b0312
FIX: Remove unnecessary forward slashes in regex 2020-05-11 17:55:44 -07:00
Penar Musaraj 7cdf41d311 DEV: Remove reference to Discourse.Category 2020-05-11 18:28:45 -04:00
Jeff Wong e744b9efec FIX: add tabindex=-1 on tabLoc post links
This prevents tabbing from confusing screenreaders, as having default tabindex
with aria-hidden confuses screenreaders
2020-05-11 14:43:12 -07:00
Penar Musaraj 90b900704b FIX: Improve mobile footer nav accessibility 2020-05-11 16:55:34 -04:00
Robin Ward b4d27d327d Revert "DEV: Remove `Discourse.Route`"
This reverts commit eed7983404.
2020-05-11 16:50:53 -04:00
Robin Ward 22af44ac49 DEV: Remove `Discourse.Mobile` 2020-05-11 16:13:29 -04:00
Robin Ward eed7983404 DEV: Remove `Discourse.Route` 2020-05-11 16:11:33 -04:00
Robin Ward 74db317974 DEV: Remove deprecation for `Discourse.Category` 2020-05-11 16:10:21 -04:00
Joffrey JAFFEUX 286b4e535e
DEV: allows buttons to define aria-label (#9747) 2020-05-11 22:09:44 +02:00
Robin Ward b4bd238dd6 DEV: Add safe deprecation to `Discourse.User` 2020-05-11 16:08:12 -04:00
Robin Ward 46730a2f0d DEV: Allow us to keep the deprecation with Ember CLI 2020-05-11 16:06:06 -04:00
Robin Ward 4c17ff98fa DEV: Remove deprecation for `Discourse.Session` 2020-05-11 15:51:10 -04:00
Robin Ward 8311374a5a DEV: Replace `version.js.erb` with pre generated file 2020-05-11 15:43:09 -04:00
Robin Ward d2b16a7618
DEV: Generate `emoji/data` on demand (#9744)
These emoji rarely change and can be re-generated when we make changes
to them.
2020-05-11 15:29:46 -04:00
Joffrey JAFFEUX af6e61defd
FIX: sets a title for notifications button (#9745) 2020-05-11 20:46:08 +02:00
jjaffeux 5a073c6a0a Revert "FIX: title should attempt to fallback to label before name (#9739)"
This reverts commit c6bf552ca3.
2020-05-11 20:09:11 +02:00
Dan Ungureanu 141f16eb6b
FIX: Multiple schema.org improvements
* Do not show "Uncategorized" category in topics list.
* Use "BreadcrumbList" only if topic is in a category.
* Add tags list as keywords to the first post.
* Add "dateModified" even if it is the same with "datePublished".
* Show "crawler-linkback-list" only if there are links to be shown.
2020-05-11 20:38:49 +03:00
jjaffeux 0deb05740f Revert "DEV: allows to define an ariaLabel on d-button (#9716)"
This reverts commit 7a95dd4841.
2020-05-11 19:19:13 +02:00
Joffrey JAFFEUX 7a95dd4841
DEV: allows to define an ariaLabel on d-button (#9716)
* DEV: allows to define an ariaLabel on d-button

This topic also adds this function to topic-footer-buttons, simplifies the whole logic of titile/label/arialabel in d-button and adds tests for these properties.

* typo
2020-05-11 18:42:51 +02:00
Joffrey JAFFEUX c6bf552ca3
FIX: title should attempt to fallback to label before name (#9739) 2020-05-11 18:42:18 +02:00
Rafael dos Santos Silva 4d137b4f89
FIX: Handle a deleted topic in thumbnail generation
Follow up to 03818e642a

A topic can be deleted between job enqueue and job execution
2020-05-11 13:32:37 -03:00
Jarek Radosz 7d3c4a5f13
FIX: Show category name in badge preview on edit (#9726) 2020-05-11 17:05:40 +02:00
Jarek Radosz a2bb33b6d7
REFACTOR: Remove an unused Topic model observer (#9723)
As far I can tell nothing sets categoryName on the Topic model. Didn't find anything in all-the-plugins/all-the-themes either.
2020-05-11 17:05:05 +02:00
Joffrey JAFFEUX addf9d62f8
FIX: prevents rendering topic-category if empty (#9720) 2020-05-11 17:45:28 +03:00
Mark VanLandingham 89c6f697b8
DEV: Plugin outlet after save or cancel composer buttons (#9725) 2020-05-11 09:23:36 -05:00
Sam Saffron 77f5bb1419
FIX: stop clearing title by mistake
b180e6e737 caused a short lived regression.

This code is very deliberate about ensuring originalTitle is
set correctly
2020-05-11 19:07:32 +10:00
Guo Xiang Tan a3a464b838
DEV: Improve description of addPosterIcon plugin api. 2020-05-11 16:44:47 +08:00
Sam Saffron b180e6e737
FIX: default to blank title on open
In production `title` was set to undefined causing a
discrepancy between originalTitle and title

This attempts to work around the issue in the production bundle
2020-05-11 18:36:09 +10:00
Joshua Rosenfeld 07b728c5e5
FEATURE: add noindex header to badges, groups, and /my pages (#9736) 2020-05-11 15:05:42 +10:00
Martin Brennan 29842e682b
FIX: Resolve issues with Next Monday for bookmarks not working in certain locales (#9737)
In moment.js the .day() function can accept a day string but this is locale based, so e.g. in Finnish locale the string "Monday" means nothing and will parse incorrectly to Sunday. To resolve this we always use the moment.js number for the day of the week we want.
2020-05-11 13:59:14 +10:00
Sam Saffron bb4e8899c4
FEATURE: let Google index pages so it can remove them
Google insists on indexing pages so it can figure out if they
can be removed from the index.

see: https://support.google.com/webmasters/answer/6332384?hl=en

This change ensures the we have special behavior for Googlebot
where we allow indexing, but block the actual indexing via
X-Robots-Tag
2020-05-11 12:15:18 +10:00
Sam Saffron 676be3a853
FEATURE: add no_index header if robots is disabled
Expand SiteSetting.allow_index_in_robots_txt so it also adds a
noindex header if set to false.

This makes sure that nothing is indexed even if it somehow reaches
Google.
2020-05-11 11:07:21 +10:00
Martin Brennan 12d4d51d81
FIX: CurrentUser now must be passed to resolveTimezone and user card local time issues (#9734)
* This is to prevent user's timezones being changed accidentally
e.g. by admin looking at a user
* This problem only occurred via the user card, however the user card
was still calling userTimezone even if the setting to display user
time in card was disabled
2020-05-11 11:01:47 +10:00
Sam Saffron 44712c5f98
FIX: ESC to dismiss empty draft topic composer
Previously originalTitle was set to undefined leading to
titleDirty being unconditionally undefined for new topics

That mean you could not dismiss the composer via ESC
2020-05-11 10:04:38 +10:00
Bianca Nenciu 8149bfbaf1
FEATURE: Filter settings by plugin (#9692) 2020-05-10 14:07:45 +03:00
Joffrey JAFFEUX 3b2b635e9b
DEV: removes setInterval as it might cause issues (#9722) 2020-05-10 08:57:48 +02:00
Joffrey JAFFEUX 862d153f54
REFACTOR: removes dead code (#9721) 2020-05-09 11:50:47 +02:00
Joffrey JAFFEUX 9bf11a8c68
DEV: allows select-kit to prevent autofocus of header after onChange (#9718) 2020-05-09 10:26:23 +02:00
Penar Musaraj d653d2f5d9 UX: Prevent timeline overlapping topic footer buttons 2020-05-08 16:20:27 -04:00
Robin Ward 34e5f807ec DEV: User UPPER_CASE for constants 2020-05-08 15:50:55 -04:00
Mark VanLandingham da561a430d
DEV: Add data-name to popular-theme-item rows (#9714) 2020-05-08 14:38:41 -05:00
Joffrey JAFFEUX 5bac2828ee
DEV: 25ms was too short and causing test failures (#9712) 2020-05-08 21:10:52 +02:00
Robin Ward b2e4ca968b DEV: Remove `translate` API from plugin.
It appears to be completely unused at this point.
2020-05-08 14:14:01 -04:00
Robin Ward 7f373e8b93 DEV: Don't use `js.erb` for constants
Adds a new rake task to auto generate a constants.js file with the
constants present. This makes migrating to Ember CLI easier, but also
slightly speeds up asset compilation by having to do less work.

If the constants change you need to run:
`rake javascripts:update_constants`
2020-05-08 14:14:01 -04:00
Jordan Vidrine 47788da706
FIX: Bookmark Modal Input (#9707) 2020-05-08 17:47:01 +02:00
Joffrey JAFFEUX 350fe932ca
DEV: removes setTimeout and reduces timer in tests (#9701) 2020-05-08 16:46:24 +02:00
Joffrey JAFFEUX 646bee2efe
DEV: removes a setTimeout and ensure shorcut is not propagated (#9702) 2020-05-08 16:46:13 +02:00
Dax74 e46bf15407
FIX: some adjustment for the UI of the table 2020-05-08 16:39:31 +02:00
Joffrey JAFFEUX 8d3900c6da
DEV: gear icon is deprecated in favor of cog (#9704) 2020-05-08 10:35:29 +02:00
Joffrey JAFFEUX 00a038d646
REFACTOR: removes various assignments and superfluous params (#9699) 2020-05-08 09:19:48 +02:00
Joffrey JAFFEUX 9d172eeaa5
REFACTOR: removes implicit operand conversion (#9700) 2020-05-08 09:19:36 +02:00
Sam Saffron d8d54a92f1
FEATURE: tighten rate limiting rules for forgot password
1. Total 6 attempts per day per user
2. Total of 5 per unique email/login that is not found per hour
3. If an admin blocks an IP that IP can not request a reset
2020-05-08 13:30:51 +10:00
Kris 1840023c28 UX: Improve banner & alert close button alignment and consistency 2020-05-07 22:57:52 -04:00
Guo Xiang Tan efd0e4d02b
FIX: Don't trigger user_updated event for bot users. 2020-05-08 09:28:16 +08:00
Krzysztof Kotlarek a3e1e9ef16
FIX: remove deprecated URI.escape (#9697)
During Nokogumbo changes I introduced back URI.escape which is deprecated.
2020-05-08 11:14:59 +10:00
Robin Ward ef94b0f1a7 FIX: Incorrect CSS class 2020-05-07 16:29:09 -04:00
Kris 94d10b46ca Admin popup menu needs a higher z-index than the bg cloak on mobile 2020-05-07 16:24:47 -04:00
Robin Ward f9608c0af5 DEV: Remove INLINE_ONEBOX_* constants
There were two constants here, `INLINE_ONEBOX_LOADING_CSS_CLASS` and
`INLINE_ONEBOX_CSS_CLASS` that were both longer than the strings they
were DRYing up: `inline-onebox-loading` and `inline-onebox`

I normally appreciate constants, but in this case it meant that we had
a lot of JS imports resulting in many more lines of code (and CPU cycles
spent figuring them out.)

It also meant we had an `.erb` file and had to invoke Ruby to create the
JS file, which meant the app was harder to port to Ember CLI.

I removed the constants. It's less DRY but faster and simpler, and
arguably the loss of DRYness is not significant as you can still search
for the `inline-onebox-loading` and `inline-onebox` strings easily if
you are refactoring.
2020-05-07 16:14:38 -04:00
Robin Ward 3567a90661 DEV: Ember Addon needs a vendor dir 2020-05-07 15:45:35 -04:00
Dax74 4891276742
Reduce the width of the input field on desktop 2020-05-07 20:36:36 +02:00
Joffrey JAFFEUX 788e305469
FIX: parenthesis were wrong, resulting in an always true expression (#9690) 2020-05-07 19:56:35 +02:00
Robin Ward 79c64eaeff
DEV: Move pretty-text into an ember-addon format (#9689) 2020-05-07 12:37:47 -04:00
Robin Ward 69ef0da4c2 FIX: `preload-store` was removed 2020-05-07 11:00:47 -04:00
Joffrey JAFFEUX 3cd412ae02
REFACTOR: removes useless variable assignment (#9666) 2020-05-07 16:41:26 +02:00
Joffrey JAFFEUX 1dd9df9cd0
REFACTOR: removes overwritten properties and duplicates fn (#9686) 2020-05-07 16:39:53 +02:00
Joffrey JAFFEUX 265baa40c6
REFACTOR: useless conditional as 'data' always evaluates to true (#9685) 2020-05-07 16:38:38 +02:00
Joffrey JAFFEUX 99c3ce03cb
REFACTOR: removes superfluous argument (#9684)
hideTooltip doesnt accept any argument
2020-05-07 16:38:23 +02:00
Joffrey JAFFEUX 206d45fd96
REFACTOR: removes superfluous argument (#9683) 2020-05-07 16:38:09 +02:00
Joffrey JAFFEUX 9846c43d93
REFACTOR: removes use of undeclared variable (#9682) 2020-05-07 16:37:56 +02:00
Joffrey JAFFEUX af78d188b8
REFACTOR: removes useless self assignment (#9681) 2020-05-07 16:37:20 +02:00
Joffrey JAFFEUX 8be0ba3aa4
REFACTOR: function was incorrectly called as a constructor (#9679) 2020-05-07 16:36:29 +02:00
Joffrey JAFFEUX e74170cd9e
REFACTOR: Superfluous arguments passed to function resolveSize (#9678)
resolveSize accepts only one param
2020-05-07 16:36:15 +02:00
Joffrey JAFFEUX affc79bb68
REFACTOR: removes useless assignment to local variable (#9676) 2020-05-07 16:35:54 +02:00
Joffrey JAFFEUX 08e8ae82cc
REFACTOR: removes useless conditional (#9677) 2020-05-07 16:34:49 +02:00
Joffrey JAFFEUX a078b086ba
REFACToR: removes useless assignment to local variable (#9675) 2020-05-07 16:34:36 +02:00
Joffrey JAFFEUX a04b226c2b
REFACTOR: removes useless conditional (#9674)
We already check if there's a post in the line before.
2020-05-07 16:34:25 +02:00
Joffrey JAFFEUX d5fe1279bd
REFACTOR: value assigned to precision here is unused (#9673) 2020-05-07 16:34:14 +02:00
Joffrey JAFFEUX a2109bd9b2
REFACTOR: value assigned to cp here is unused. (#9672) 2020-05-07 16:30:51 +02:00
Joffrey JAFFEUX 930989d462
REFACTOR: variable '_postSnapshot' always evaluates to true (#9671) 2020-05-07 16:28:28 +02:00
Joffrey JAFFEUX d020e70643
REFACTOR: removes unreachable return statement (#9670) 2020-05-07 16:27:53 +02:00
Joffrey JAFFEUX 48375db848
REFACTOR: removes superfluous argument passed to findWidget (#9669)
findWidget accepts only one argument
2020-05-07 16:27:15 +02:00
Joffrey JAFFEUX 5a201082c7
REFACTOR: removes useless conditional (#9667)
This use of variable 'content' always evaluates to true.
2020-05-07 16:25:44 +02:00
Joffrey JAFFEUX 864f48b2e6
REFACTOR: removes useless conditional (#9668)
Given we will return true on the line before if inlineEmoji, this will always be false.
2020-05-07 16:25:23 +02:00
Joffrey JAFFEUX 01272f2085
REFACTOR: removes unreachable code (#9665)
* REFACTOR: removes unreachable code

* this one too
2020-05-07 16:24:54 +02:00
Joffrey JAFFEUX ac4251fc9d
REFACTOR: publishedPage property was duplicated (#9664) 2020-05-07 16:24:35 +02:00
Joffrey JAFFEUX 87b1d435d2
FIX: improves positioning of sk in mobile when inside a modal (#9657) 2020-05-07 09:10:29 +02:00
Martin Brennan 37be2958f7
DEV: Allow specifying if a notification is high_priority on create (#9660)
This allows for special cases where we may not want a certain notification type to ALWAYS be high priority (e.g. a topic timer).
2020-05-07 14:35:32 +10:00
Martin Brennan be48e503fd
FIX: Show the Bookmark button for PM topics (#9659)
There is no point in suppressing this now that we have bookmark reminders.
2020-05-07 14:30:10 +10:00
Martin Brennan 6fb0f36ce1
FEATURE: Optionally delete bookmark when reminder sent (#9637)
We now show an options gear icon next to the bookmark name.

When expanded we show the "delete bookmark when reminder sent" option. The value of this checkbox is saved in local storage for the user.

If this is ticked, when a reminder is sent for the bookmark the bookmark itself is deleted. This is so people can use the reminder functionality by itself.

Also remove the blue alert reminder section from the "Edit Bookmark" modal as it just added clutter, because the user can already see they had a reminder set:

Adds a default false boolean column `delete_when_reminder_sent` to bookmarks.
2020-05-07 13:37:39 +10:00
Penar Musaraj 423802fbce UX: Fix modal positioning when iOS keyboard is visible 2020-05-06 23:06:57 -04:00
Kris 33c8adda83 UX: Adjust admin menu to better fit short (horizontal) viewports 2020-05-06 22:59:22 -04:00