Commit Graph

38364 Commits

Author SHA1 Message Date
ab4c0a4970 FEATURE: Create SQL-only backup if there are no uploads
It doesn't make sense to compress the database dump twice if the backup doesn't contain any uploaded files.
2020-07-07 16:23:47 +02:00
10e2578751 FIX: Set default value for poll result field (#10178) 2020-07-07 17:23:21 +03:00
57d46694c5 DEV: Fix flaky test 2020-07-07 17:10:24 +03:00
333d4f9a98 FIX: Redirect user to the URL with the correct category slug (#10167)
This commit implements a category redirect similar to the one for topic
URLs with wrong slug.
2020-07-07 15:25:36 +03:00
f92116d695 Revert "DEV: flexify post actions (#9926)"
This reverts commit 6ef0e98f4e07efd1fba36e8315d53559e22a9a8f.
2020-07-07 12:42:49 +02:00
56475f57c5 UX: simplifies editing email templates by always having a default (#10179) 2020-07-07 11:44:13 +02:00
9b7000dbf1 FIX: ensures category order keeps consistent (#10165)
Before this change:
- first full page load would get category defaults defined un cateory settings
- a navigation to a topic and then back to categories list would reset defaut to the ones defined in discovery/topics
2020-07-07 09:56:38 +02:00
0c742dd022 DEV: Simple formatting fix. 2020-07-07 15:46:14 +08:00
f3f30edf3f SPEC: use post number to create canoncial path in mega topics.
6d177659247370f6be4c4e83f12d944f3d75bf92
2020-07-07 12:20:31 +05:30
72861f4e1c FIX: add table CSS rules to normalize (#10176)
* FIX: add table CSS rules to normalize

In the new version of normalize - 8.0.1 `  `table` and `td` CSS rules are missing
https://github.com/necolas/normalize.css/blob/master/normalize.css

They existed in version `3.0.1` https://github.com/necolas/normalize.css/blob/3.0.1/normalize.css#L417

Also, extracted custom rules to new file
2020-07-07 16:47:03 +10:00
280cd99c62 DEV: Add extra appEvents to composer workflow
* add composer:saved, composer:created-post, and composer:edited-post
  appEvents inside the composer controller, to make it easier to detect
  these events in plugins
2020-07-07 14:13:45 +10:00
9075d5a9f5 Revert "FIX: Set default value for poll result field (#10044)"
This reverts commit 40de5352248df3e17c7d790f5a0c89a2162cca46.

Sadly this appears to break the JS test suite
2020-07-07 10:24:37 +10:00
556f7dc9c0 FIX: Fix race condition when resolving tag and category hashtags (#10153)
* FIX: Fix race condition when resolving tag and category hashtags

If the category hashtags were resolved first and then tag hashtags, then
the tags would overwrite the categories. Similarly, if the category
hashtags were resolved last it would overwrite even hashtags which ended
with '::tag'.

* DEV: Add test

* DEV: Fix test
2020-07-07 10:20:51 +10:00
b9e3db6387 UX: Add link to user email preferences in admin view (#10169) 2020-07-07 10:20:14 +10:00
e08b860e88 FIX: Improve category hashtag lookup (#10133)
* FIX: Improve category hashtag lookup

This commit improves support for sub-sub-categories and does not include
the ID of the category in the slug, which fixes the composer preview.

* FIX: Sub-sub-categories can be mentioned using only two levels

* FIX: Remove support for three-level hashtags

* DEV: Simplify code
2020-07-07 10:19:01 +10:00
6ef0e98f4e DEV: flexify post actions (#9926)
* DEV: flexify post actions

* more tweaks
2020-07-07 10:18:01 +10:00
40de535224 FIX: Set default value for poll result field (#10044) 2020-07-07 10:16:21 +10:00
1f5cecaf28 Minor follow up fix to 4f12768 for mobile 2020-07-06 19:17:30 -04:00
4f12768d10 UX: Remove extra space added by img resize controls in composer preview 2020-07-06 19:11:58 -04:00
339549d14a Support plugin and Theme compatibility version manifests (#9995)
Adds a new rake task `plugin:checkout_compatible_all` and
`plugin:checkout_compatible[plugin-name]` that check out compatible plugin
versions.

Supports a .discourse-compatibility file in the root of plugins and themes that
list out a plugin's compatibility with certain discourse versions:

eg: .discourse-compatibility
```
2.5.0.beta6: some-git-hash
2.4.4.beta4: some-git-tag
2.2.0: git-reference
```

This ensures older Discourse installs are able to find and install older
versions of plugins without intervention, through the manifest only.

It iterates through the versions in descending order. If the current Discourse
version matches an item in the manifest, it checks out the listed plugin target.
If the Discourse version is greater than an item in the manifest, it checks out
the next highest version listed in the manifest.

If no versions match, it makes no change.
2020-07-06 14:48:00 -07:00
2e13ed061d FIX: Generate Topic Thumbnails nil to Array error
If any value, including nil, is passed in as an argument the default
won't be set, so we need to handle when a non-Array value is passed in
to the `generate_thumbnails!` method.
2020-07-06 15:35:33 -06:00
90524906ee DEV: Fix OptimizedImage specs 2020-07-06 21:51:56 +02:00
cb048d284d FIX: Handle the case where upload goes missing during downsizing 2020-07-06 18:51:38 +02:00
da0fc0a9d3 DEV: Cleanup PostActionType and ReviewableScore changes in tests
Followup to 2df388ffd7279ec7738691bf133ef2a63834610e
2020-07-06 17:12:23 +01:00
7a6d772ad2 DEV: couple bug fixes in getsatisfaction importer
- Ensure we don't modify a frozen string
- Ensure we have a slug before trying to create a permalink
2020-07-06 17:41:28 +02:00
7f2b5a446a PERF: Remove post_upload recovery in daily EnsureS3UploadsExistence job (#10173)
This is a very expensive process, and it should only be required in exceptional circumstances. It is possible to run a similar recovery using `rake uploads:recover` (5284d41a8e/lib/upload_recovery.rb (L135-L184))
2020-07-06 16:26:40 +01:00
194c962124 FIX: Do not rerender widget-dropdown on all clicks (#10100)
Because of how the dropdown was structured, as long it was in the DOM, all clicks outside the widget would rerender it.

This commit introduces `widget-dropdown-body` that handles the `clickOutside` callback and is rendered conditionally, so it won't get called when the dropdown is closed.
2020-07-06 17:04:16 +02:00
3b51e05de2 FIX: CookText may be gone before promise resolves (#10097)
* FIX: CookText may be gone before promise resolves

Bug introduced in 293467a37ae33c5fd8fd40bbfc05bffa578b90ed.

* DEV: Drop the window.requireModule in cook-text

It was introduced in 2017 in 232311aa8c8e879c98dc061ac1755ee4d0dd9b0f but doesn't seem to be necessary anymore.
2020-07-06 17:03:27 +02:00
64ce12a758 FIX: OptimizedImage#filesize (#10095)
`OptimizedImage#filesize` calls `Discourse.store.download` with an OptimizedImage as an argument. It would in turn attempt to call `#original_filename` and `#secure?` on that object. Both would fail as these methods do not exist on OptimizedImage, only on Upload. We didn't know about these issues because:
1. `#calculate_filesize` is not called often, because the filesize is saved on OptimizedImage creation, so it's used mostly for manual filesize recalculation
2. we were using `rescue nil` which swallows all errors
2020-07-06 17:01:29 +02:00
3792ffa556 DEV: Update method documentation in lib/computed.js (#10172) 2020-07-06 09:26:21 -05:00
cb421b5358 Build(deps): Bump nokogiri from 1.10.9 to 1.10.10 (#10171)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.9 to 1.10.10.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.9...v1.10.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-06 10:13:23 -04:00
Joe
6e341f1839 UX: restore table borders
Newer versions of Normalize remove the `border-collapse: collapse;` property and fallback to browser defaults. This commit restores that property because we're using it in quite a few places.
2020-07-06 21:25:41 +08:00
98786cb037 DEV: Refactor basic-topic-list to use topic-list-item on mobile (#10105)
Previously, basic-topic-list had its own implementation of topic-list-item on mobile, which made it more difficult to maintain and extend. The visible difference was that the basic-topic-list implementation had no large avatar on the left. This commit adds a new hideMobileAvatar parameter to topic-list-item and topic-list, and sets it to `true` for the basic-topic-list component.
2020-07-06 13:58:57 +01:00
525a2174b3 Restore 'pointer' cursor on buttons
Normalize removed their opinionated cursor styling of buttons in [4.0.1](170455d6f6).

Follow-up-to: 1fd3a30a597f1e5973266489e32482ddba446e48
2020-07-06 13:15:31 +02:00
1bd8a075d8 FIX: Make Email::Styles operate on html documents instead of fragments
`Nokogiri::HTML.fragment` is a huge hack (a comment in the source code
admits this). The current behavior of `Email::Styles` is to try to
emulate `fragment` using nokogumbo, but it misses some edge cases. In
particular, meta tags in a email template don't make it through to the
final email.

Instead of treating the provided HTML as an indeterminate fragment, this
commit makes `Email::Styles` treat the HTML as a complete document. This
means that the generated HTML for an email will now always contain top
level structure (a doctype, html, head and body tags).

This new behavior is behind a hidden site setting for now and defaults
off.
2020-07-06 11:45:39 +01:00
cb1b472a0f PERF: Do not include thumbnail information in default topic list payload (#10163)
Now it is only included when a theme/plugin has requested it.
2020-07-06 10:59:21 +01:00
5284d41a8e FEATURE: Optionally skip the create account popup for external auth 2020-07-06 10:18:57 +01:00
041d28295f UX: Hide login button during externally authenticated account creation
Also switch to use the new d-button loading property for the create account button
2020-07-06 10:18:49 +01:00
977766e7a8 FEATURE: sso_overrides_(email|username|name) for all auth methods
These settings previously applied only to discourse-sso. Now they work for all external authentication methods.
2020-07-06 10:18:45 +01:00
ec448a1516 DEV: Refactor Auth::Result for readability, recreate during signup flow 2020-07-06 10:18:41 +01:00
789a15a897 DEV: allows autocomplete to be debounced (#10166)
Usage:

```
$(".foo").autocomplete({debounced: true});
```
2020-07-06 09:28:57 +02:00
b2a2e4f1e5 FIX: ensures seconds are displayed when used with dates (#10170) 2020-07-06 09:26:31 +02:00
6d17765924 PERF: use post number to create canoncial path in mega topics.
We don't need page number accuracy in mega topics since it can be expensive.

06d426bd87d5bf87e36dd543efd298aaef94156e
2020-07-06 10:31:19 +05:30
227ddb214e DEV: Add commit to ignore for git blame. 2020-07-06 08:58:53 +08:00
38a30a6e96 DEV: correct regression and correct tests
etag change in 31976ecf was incorrect, revert it

Also correct regression in test suite.
2020-07-06 10:56:19 +10:00
199a53e936 UX: suppress "in reply to" section in emails by default
Previously we would include this section, unfortunately

1. It is usually elided in gmail
2. It can make the emails longer and more confusing
3. Omission is a feature, it means people need to visit site to get context
2020-07-06 10:40:04 +10:00
31976ecfeb PERF: only update etag when it changes
Previously when synchronizing upload etags we would update every single one
regardless of change.
2020-07-06 10:40:04 +10:00
1fd3a30a59 FIX: update normalize css from 3.0.1 to 8.0.1 (#10141)
It is a second attempt to this update. First one was reverted here https://github.com/discourse/discourse/pull/8618

We noticed a problem that `like` counter had incorrect colour on mobile.

I added a missing rule to the bottom of the file (that rule existed in normalize-3 and was removed in normalize-8)

```
button,
input,
optgroup,
select,
textarea {
  color: inherit;
}
```
2020-07-06 09:09:30 +10:00
06d426bd87 FIX: skip hidden posts while generating canonical url.
Previously, while generating the topic page's canoncial url we used the current post number. It will create invalid canonical path if the topic has whsiper posts. Now we only taking the visible posts for current page index calculation.
2020-07-05 14:04:31 +05:30
6b4cebed3e DEV: Instance#replace_flags block should be optional 2020-07-03 16:21:06 -03:00