Commit Graph

39490 Commits

Author SHA1 Message Date
Jarek Radosz 8e47532304
DEV: Add template linting to the CI workflow (#10821) 2020-10-05 19:52:39 +02:00
Robin Ward 4dec7d85d0 REFACTOR: Removes `Discourse.SiteSettings` constant from tests
This does not work in the Ember CLI world.
2020-10-05 13:52:13 -04:00
Penar Musaraj a4356b99af
FEATURE: Separate base and heading font site_settings (#10807)
Allows site administrators to pick different fonts for headings in the wizard and in their site settings. Also correctly displays the header logos in wizard previews.
2020-10-05 13:40:41 -04:00
Bianca Nenciu bdfb370f19
FIX: Disallow email invites if enable_local_logins is disabled (#10805)
allowEmails used to always be set to true and did not use
can_invite_via_email, which checks for enable_local_logins.

It was a problem because on sites with local logins
disabled users were allowed to enter email addresses, but
received a generic error "error inviting that user".
2020-10-05 19:38:22 +03:00
Bianca Nenciu 318efa8093
FIX: Always let moderators to see their group PMs (#10813)
When enable_personal_messages was disabled, moderators could not see
the private messages for the "moderators" group. The link was displayed
on the client side, but the checks on the server side did not allow it.
2020-10-05 19:38:08 +03:00
Robin Ward 969917c4a2 Hide large refactor commit from blame
It's mostly about moving tests from one place to another and needn't
pollute the git history.
2020-10-05 12:09:34 -04:00
Robin Ward 80a5482f28 Embedded topics are now unlisted by default
Previously this site setting `embed unlisted` defaulted to false and
empty topics would be generated for embed, but those topics tend to take
up a lot of room on the topic lists.

This new default creates invisible topics by default until they receive
their first reply.
2020-10-05 12:09:20 -04:00
Robin Ward 070fe7f45d FIX: Deprecated overwriting of computed property
We can set `hide` to true instead of overwriting the property on
dismiss.
2020-10-05 12:09:01 -04:00
Joffrey JAFFEUX e6821fbaae
DEV: fixes linting of hbs files in core plugins (#10820) 2020-10-05 14:42:36 +02:00
Jarek Radosz cf44cdb082
FIX: Validate category name on parent change (#10815)
Previously, moving a category into another one, that already had a child category of that name (but with a non-conflicting slug) would cause a 500 error:

```
# PG::UniqueViolation:
#   ERROR:  duplicate key value violates unique constraint "unique_index_categories_on_name"
#   DETAIL:  Key (COALESCE(parent_category_id, '-1'::integer), name)=(5662, Amazing Category 0) already exists.
```

It now returns 422, and shows the same message as when you're renaming a category: "Category Name has already been taken".
2020-10-05 11:50:05 +02:00
Joffrey JAFFEUX 702f7a5a67
FIX: makes dashboard periods use current day and weekly 7 days (#10817)
Prior to this fix, weekly could be 8 days and we could have differences between period chooser text and actual results in the chart.

A good followup to this PR would be to add custom date ranges in period-chooser component.
2020-10-05 10:32:12 +02:00
Jarek Radosz 4b5358bb42
FIX: Preload uploads in groups#search to stop N+1 (#10814)
`BasicGroupSerializer` includes `flair_url` which uses `flair_upload` relation, so the N in N+1 in this case was the number of groups with flair in the forum.
2020-10-05 10:22:55 +02:00
dependabot-preview[bot] 01a9c57dcb
Build(deps-dev): Bump better_errors from 2.8.2 to 2.8.3 (#10812)
Bumps [better_errors](https://github.com/BetterErrors/better_errors) from 2.8.2 to 2.8.3.
- [Release notes](https://github.com/BetterErrors/better_errors/releases)
- [Commits](https://github.com/BetterErrors/better_errors/compare/v2.8.2...v2.8.3)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-03 12:32:19 +02:00
Arpit Jalan 9b45391cf9
FEATURE: explain why invites are disabled to staff users (#10810)
Co-authored-by: Robin Ward <robin.ward@gmail.com>
2020-10-03 13:05:26 +05:30
Penar Musaraj 97f34d7b71
FIX: Hide empty popular/recent sections in 404 page (#10811) 2020-10-02 15:11:15 -04:00
Robin Ward e363b113a8 FIX: Build was broken because uglify can't accept `let` or `const`
For now we can live with `var`.
2020-10-02 12:04:33 -04:00
Robin Ward 23f24bfb51 REFACTOR: Move javascript tests inside discourse app
This is where they should be as far as ember is concerned. Note this is
a huge commit and we should be really careful everything continues to
work properly.
2020-10-02 11:29:36 -04:00
Gerhard Schlager 99181bb3b8
FIX: Stripping lines from incoming email shouldn't fail for blank body (#10800) 2020-10-02 15:44:35 +02:00
Jarek Radosz babbebfb35
FEATURE: Add the title attribute to polls (#10759)
Adds an optional title attribute to polls. The rationale for this addition is that polls themselves didn't contain context/question and relied on post body to explain them. That context wasn't always obvious (e.g. when there are multiple polls in a single post) or available (e.g. when you display the poll breakdown - you see the answers, but not the question)

As a side note, here's a word on how the poll plugin works:

> We have a markdown poll renderer, which we use in the builder UI and the composer preview, but… when you submit a post, raw markdown is cooked into html (twice), then we extract data from the generated html and save it to the database. When it's render time, we first display the cooked html poll, and then extract some data from that html, get the data from the post's JSON (and identify that poll using the extracted html stuff) to then render the poll using widgets and the JSON data.
2020-10-02 09:21:24 +02:00
Vinoth Kannan d0d61e4118
FIX: remove whitespaces around inline HTML tags next to text. (#10803) 2020-10-02 10:56:40 +05:30
Guo Xiang Tan 495c79da1a Revert "FIX: Use topic title headline in search menu result."
This reverts commit 4b8c15b857.

This breaks topic title for topic similar search.
2020-10-02 13:12:31 +08:00
Guo Xiang Tan 4b8c15b857 FIX: Use topic title headline in search menu result. 2020-10-02 09:04:54 +08:00
dependabot-preview[bot] f4c4a2a7f1 Build(deps-dev): Bump better_errors from 2.8.1 to 2.8.2
Bumps [better_errors](https://github.com/BetterErrors/better_errors) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/BetterErrors/better_errors/releases)
- [Commits](https://github.com/BetterErrors/better_errors/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-02 09:04:28 +08:00
Penar Musaraj d6038ac666
FIX: Clear notification of skipped narrative bot PM (#10792)
Resets a new user's PM count in their badge after skipping user tips.
2020-10-01 20:32:45 -04:00
Krzysztof Kotlarek 5cf411c3ae
FIX: move hp request from /users to /token (#10795)
`hp` is a valid username and we should not prevent users from registering it.
2020-10-02 09:01:40 +10:00
Robin Ward 29f7e0689f DEV: Hide large commit for moving test directories 2020-10-01 14:19:15 -04:00
Robin Ward 901ae1ddd1 FIX: Allow staff to use HTML in the category read only banner 2020-10-01 11:55:35 -04:00
Jarek Radosz 891987a284
DEV: Recover missing files of existing uploads (#10757)
UploadRecovery only worked on missing Upload records. Now it also works with existing ones that have an invalid_etag status.

The specs (first that test the S3 path) are a bit of stub-a-palooza, but that's how much this class interacts with the the outside world. 🤷‍♂️
2020-10-01 14:54:45 +02:00
Roman Rizzi 7d5b18b7cf
FIX: Migration should only update ReviewableUsers where the user is not approved. (#10790)
The reviewable was updated despite the user not being approved because a u.id = r.target_id condition is missing. It only affected user reviewables that were pending when the migration ran. Users were not auto-approved.
2020-10-01 08:49:10 -03:00
dependabot-preview[bot] 3de832248e
Build(deps): Bump rspec-core from 3.9.2 to 3.9.3 (#10791)
Bumps [rspec-core](https://github.com/rspec/rspec-core) from 3.9.2 to 3.9.3.
- [Release notes](https://github.com/rspec/rspec-core/releases)
- [Changelog](https://github.com/rspec/rspec-core/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-core/compare/v3.9.2...v3.9.3)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-01 17:30:25 +10:00
Robin Ward 9f95511096 DEV: Add support for `api-initializers` to reduce boilerplate.
You can now create a file in your plugin/theme in the `api-initializers`
directory which has a simpler template than previous initializers.
Example:

```
// api-initializers/my-plugin.js
import { apiInitializer } from "discourse/lib/api";

export default apiInitializer("0.8", api => {
  console.log("hello world from api initializer!");
});
```
2020-09-30 16:05:44 -04:00
Robin Ward a3c81a85cd
Update server.en.yml 2020-09-30 14:11:26 -04:00
Robin Ward e2b9d93556
Update server.en.yml 2020-09-30 14:11:12 -04:00
Jeff Atwood 8fd8114e97 minor copyedit 2020-09-30 10:46:27 -07:00
Penar Musaraj fb57fe7e36
FIX: Allow .otf fonts to be delivered via cdn (#10787)
The discourse-fonts package includes NotoSansJP (bold and regular), but
it is an OTF font, and it results in 404s in CDN requests.
2020-09-30 11:59:46 -04:00
Gerhard Schlager f5c4594f6d DEV: Fix heisentest 2020-09-30 17:20:56 +02:00
Arpit Jalan ff44515a18
FIX: better error message if invite is expired (#10783)
https://meta.discourse.org/t/invite-token-is-invalid/165270/5?u=techapj
2020-09-30 20:32:33 +05:30
dependabot-preview[bot] a13497dd1f Build(deps): Bump rotp from 6.1.0 to 6.2.0
Bumps [rotp](https://github.com/mdp/rotp) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/mdp/rotp/releases)
- [Changelog](https://github.com/mdp/rotp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mdp/rotp/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-30 10:58:15 -04:00
Robin Ward 445d6ba45f REFACTOR: Move qunit tests to a different directory structure
This structure is closer to how ember-cli expects tests to be placed. It
is not their final position, just the first step towards it.
2020-09-30 10:36:49 -04:00
Robin Ward 8945a752f2 FIX: Deprecation overwriting `translatedText` CP
This allows us to pass a `textParams` object for options that will be
translated via i18n.
2020-09-30 10:36:31 -04:00
Robin Ward eac5dfd1ef Update app/assets/javascripts/discourse/app/templates/components/share-popup.hbs
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2020-09-30 10:35:46 -04:00
Robin Ward 3d6d3e6cb1 REFACTOR: Remove deprecated `action="something"` attributes
In newer versions of Ember, `this.sendAction` is deprecated:

https://deprecations.emberjs.com/v3.x/#toc_ember-component-send-action

This patch removes most of our current uses (via `d-button`) but also
some other rogue `this.sendAction` calls too.
2020-09-30 10:35:46 -04:00
Daniel Waterworth da0dea1e94
FIX: Make bundler CI cache setup explicit (#10785)
Instructions on how to set this up exist at:

https://github.com/actions/cache/blob/master/examples.md#ruby---bundler

The second step was omitted, but it did not seem to prevent caching for unknown reasons.
2020-09-30 13:33:22 +00:00
Joffrey JAFFEUX 318dadaf37
FIX: correct value of auto and adds nohighlight to the description (#10771) 2020-09-30 15:39:47 +10:00
Martin Brennan 39b2fb8649
FIX: Invalid URLs could raise exceptions when calling UrlHelper.rails_route_from_url (#10782)
Upload.secure_media_url? raised an exceptions when the URL was invalid,
which was a issue in some situations where secure media URLs must be
removed.

For example, sending digests used PrettyText.strip_secure_media,
which used Upload.secure_media_url? to replace secure media with
placeholders. If the URL was invalid, then an exception would be raised
and left unhandled.

Now instead in UrlHelper.rails_route_from_url we return nil if there is something wrong with the URL.

Co-authored-by: Bianca Nenciu <nenciu.bianca@gmail.com>
2020-09-30 15:20:00 +10:00
Jeff Atwood a0bbc346cb minor copyedit 2020-09-29 16:47:54 -07:00
Jordan Vidrine 3d1ab601d0
UI: Remove background from group notifications of @mentions (#10775)
This commit removes the background color from group @mention notifications. This resolves visual contrast issues when 'unread' styles are applied.
2020-09-29 18:44:12 -05:00
Gerhard Schlager 9d4009b0e8
FIX: Use correct locale for error messages (#10776)
Error messages for exceeded rate limits and invalid parameters always used the English locale instead of the default locale or the current user's locale.
2020-09-29 21:42:45 +02:00
Robin Ward 4987d61448 FIX: We were overriding the `canCreateTopicOnCategory` computed property
It seems to be set everytime by the route so the old CP was not
required. This is not allowed in newer versions of ember.
2020-09-29 14:57:34 -04:00
Arpit Jalan 025490ecb9
FEATURE: composer option to reload page and force save draft (#10773) 2020-09-29 22:29:03 +05:30