Commit Graph

1548 Commits

Author SHA1 Message Date
Penar Musaraj 24e71acf3f
UX: Normalize sizing for inputs, buttons, dropdowns (#14226)
See PR for details
2021-09-09 11:01:56 -04:00
Kris 5c0ad215af
UX: adjust button spacing (#14230) 2021-09-07 13:19:03 -04:00
Robin Ward 09764291b1 FIX: In test mode, initializers were modifying classes over and over
This adds a new property, `pluginId` which you can pass to `modifyClass`
which prevent the class from being modified over and over again.

This also includes a fix for polls which was leaking state between tests
which this new functionality exposed.
2021-09-02 11:22:01 -04:00
Discourse Translator Bot c995b20ca4
Update translations (#14063) 2021-08-24 15:25:44 +02:00
Joffrey JAFFEUX 6c0efd50bc
linting (#14115) 2021-08-23 14:21:58 +02:00
Joffrey JAFFEUX d7c185bf3d
DEV: updates chart.js to 3.5.1 (#14107) 2021-08-23 13:49:49 +02:00
Joffrey JAFFEUX cb59681d86
DEV: select-kit third major update with focus on accessibility (#13303)
Major changes included:
- better support for screen readers
- trapping focus in modals
- better tabbing order in composer
- alerts on no content found/number of items found
- better autofocus in modals
- mini-tag-chooser is now a multi-select component
- each multi-select-component will now display selection on one row
2021-08-23 10:44:19 +02:00
David Taylor 5eb4e642a6
DEV: Rename discourse-presence endpoints and messagebus channels (#14089)
We are working to introduce a general core API for presence, which will clash with this plugin's `/presence` namespace

This commit introduces no functional change. There may be a slight interruption in discourse-presence functionality during a deploy of this commit.
2021-08-19 13:04:31 +01:00
Discourse Translator Bot 0e53769f71
Update translations (#13994) 2021-08-14 10:18:05 +02:00
Joffrey JAFFEUX 4ca34940d3
DEV: ensures container is not destroyed before showing tooltip (#13992)
In fast tests it could results in an error.
2021-08-10 11:48:31 +02:00
Jarek Radosz e68c1d5ba5
DEV: Use `key` over the deprecated `keyCode` (#13795)
Makes the code a bit more readable. Inspired by https://github.com/emberjs/ember.js/pull/19185
2021-08-09 11:41:36 +02:00
Joffrey JAFFEUX 11668ee85b
PERF: generates dates tooltip on demand (#13944) 2021-08-04 16:28:07 +02:00
Discourse Translator Bot 6b87ae3d4c
Update translations (#13929) 2021-08-04 14:14:52 +02:00
Joffrey JAFFEUX d23c0c06c3
PERF: reduces rendering time of local-dates (#13931)
- prefers insertAdjacentHTML over innerHTML as it's much faster in this case (about 5x)
- memoizes tz.guess()
- memoizes list of timezones
- inlines template
- applies main element class in one pass

All in all for a very edge case of about 80 dates it should be faster of about 15/20ms.
2021-08-04 08:27:22 +02:00
Jordan Vidrine 465db1e5b5
FIX: Adjust poll buttons (#13924)
* FIX: Adjust poll buttons

* REFACTOR: Move styles to desktop stylesheet
2021-08-03 10:03:18 +08:00
Discourse Translator Bot 0c422cff1e
Update translations (#13898) 2021-07-30 11:30:10 +02:00
Discourse Translator Bot e951cb9aef
Update translations (#13860) 2021-07-27 15:24:03 +02:00
Discourse Translator Bot 3667cc6447
Update translations (#13821) 2021-07-22 12:31:19 +02:00
Joffrey JAFFEUX 5eb6e9281a
FIX: manually adds frowning_face_with_open_mouth for apple (#13528) 2021-07-21 23:27:20 +02:00
Discourse Translator Bot 28b5e6e47d
Update translations (#13796) 2021-07-21 10:30:34 +02:00
Michael Brown 5f7e60d9dc discourse/discourse change from 'master' to 'main' 2021-07-19 11:46:15 -04:00
Gerhard Schlager ec9a2a04f3
Fix i18n issues reported on Crowdin (#13769)
* Removes unused strings
* Clarifies some of the strings
* Fixes typos

@discourse-translator-bot keep_translations_and_approvals
2021-07-19 09:30:48 +08:00
David Taylor 8b89787426
SECURITY: Sanitize YouTube Onebox data (#13748)
CVE-2021-32764
2021-07-15 19:31:50 +01:00
Discourse Translator Bot 53fe8b2e77
Update translations (#13647) 2021-07-13 20:30:09 +02:00
Bianca Nenciu 87c1e98571
FEATURE: Let users select flair (#13587)
User flair was given by user's primary group. This PR separates the
two, adds a new field to the user model for flair group ID and users
can select their flair from user preferences now.
2021-07-08 10:46:21 +03:00
Bianca Nenciu 573a71fdd9
DEV: Do not skip pages when loading polls (#13649)
In some conditions, pages were skipped. This was implemented in the past
in f490a8d, but then reverted in 04ec543, because sometimes it was stuck
reloading the first page.

The code that loads more results was simplified and a lot of duplicate
code was removed. The logic to remove users who changed their vote was
also introduced again, but just for the regular polls.
2021-07-07 13:06:08 +03:00
Roman Rizzi 7925a76d93
DEV: An endpoint to check if the current user voted in a poll. (#13648)
The endpoint the existence of the poll and if the current user can see it. It
will facilitate using a poll programmatically, especially if we'd like to create an external poll through a theme component.
2021-07-06 14:46:34 -03:00
Kane York 38332cae21
FIX: Multiply ratelimiter leniency for own discobot certs (#13639) 2021-07-06 10:23:57 +10:00
Régis Hanol 04ec5439f3
FIX: Poll wasn't showing all voters (#13620)
Partially revert f490a8d39a because we aren't able to
load more than the initially preloaded voters.

We were always trying to load the 1st page of voters.

Also removed the "remove users who changed their vote" logic as it was not properly working in multiple choices polls.

cc @nbianca
2021-07-05 13:52:17 +03:00
Alan Guo Xiang Tan 37b8ce79c9
FEATURE: Add last visit indication to topic view page. (#13471)
This PR also removes grey old unread bubble from the topic badges by
dropping `TopicUser#highest_seen_post_number`.
2021-07-05 14:17:31 +08:00
Régis Hanol b8a0e47913
UX: make poll content selectable (#13529)
When initially released, the polls had a different design that didn't interact
well with the quote button - https://meta.discourse.org/t/31586

Now that the design has evolved, not being able to select text from inside a poll is
counter productive, so it's enabled again.
2021-06-30 15:25:59 +10:00
Jarek Radosz aa56e2a758
DEV: Don't use the Ember global (#13535) 2021-06-29 19:54:18 +02:00
Discourse Translator Bot 23930738a7
Update translations (#13565) 2021-06-29 16:02:02 +02:00
Gerhard Schlager a216862fe1 Fix spelling in `discourse_narrative_bot.new_user_narrative.flag.instructions`
This fixes https://discourse.crowdin.com/translate/f3230e7607a36bb0a2f97fd90605a44e/278/en-fr#51512

@discourse-translator-bot keep_translations_and_approvals
2021-06-25 00:16:29 +02:00
Robin Ward a2b744ae25 DEV: Allow plugin tests to run in Ember CLI qunit 2021-06-24 10:13:35 -04:00
David Taylor 5968dc07a5 DEV: Promote historic post_deploy migrations
This commit promotes all post_deploy migrations which existed in Discourse v2.6.7 (timestamp <= 20201110110952)
2021-06-23 17:43:38 +01:00
Discourse Translator Bot 252dd169a4
Update translations (#13476) 2021-06-22 15:21:20 +02:00
Bianca Nenciu f490a8d39a
FIX: Do not display twice a user who changed vote (#13284)
* FIX: Fetch last page again if incomplete

The next fetched page number used to increase continuously even if the
last page was incomplete and fetching it again could have new voters.

* FIX: Do not display twice a user who changed vote

A user could appear under two voting options when they changed their
vote because pressing the Load More Voters button updated only the
current option.
2021-06-18 18:56:54 +03:00
Penar Musaraj e305365168
FEATURE: Use responsive image sizes in post stream (#13343) 2021-06-18 09:15:03 -04:00
Robin Ward fc61a7c0de
FIX: `count` is not defined lint error (#13347) 2021-06-09 11:26:26 -04:00
Robin Ward 77d33ebe21
FIX: Lots of plugin tests were using old, non-Ember compat CLI APIs (#13320) 2021-06-09 10:58:55 -04:00
Jarek Radosz 21e8a33177
DEV: Clean up QUnit tests (#13328)
* DEV: Use `query` helper instead of `queryAll()[0]`
* DEV: Replace `queryAll().length` w/ `exists()`/`count()`
* DEV: Use `exists()` instead of `count() > 0`, `count() === 0`
* DEV: Use `count()`/`exists()` instead of `find().length`
2021-06-08 17:54:12 +02:00
Discourse Translator Bot f941bbc147
Update translations (#13327) 2021-06-08 16:32:36 +02:00
Jarek Radosz bd2b2bcf9c DEV: Clean up the spec 2021-06-08 09:28:40 +08:00
Jarek Radosz f875079b1a DEV: Fix spec filename typo 2021-06-08 09:28:40 +08:00
Jarek Radosz 0a259b94f0 DEV: Fix an `ActiveModel::Errors` deprecation
The warning was:

DEPRECATION WARNING: Calling `<<` to an ActiveModel::Errors message array in order to add an error is deprecated. Please call `ActiveModel::Errors#add` instead. (called from block (3 levels) in activate! at discourse/plugins/poll/plugin.rb:519)
2021-06-07 11:34:38 +08:00
Penar Musaraj 9ebc9541b9
FIX: Size of emoji in poll options (#13294)
Fixes a regression in 33cb1b
2021-06-04 18:27:25 -04:00
Penar Musaraj 33cb1b7cf1
FIX: Ensure images in polls don't cause abrupt scrolling (#13272)
In some very rare cases, poll options can end up with images that have
no dimensions, in which case, navigating to replies in that post stream
might result in unexpected scrolling (as the browser loads the images
and adjusts its layout).

This ensures that if width/height attributes are missing from an image,
the image is forced to display within a 200 by 200 pixels space.

Co-authored-by: David Taylor <david@taylorhq.com>
2021-06-03 22:09:59 -04:00
Discourse Translator Bot 8a99ee88bd
Update translations (#13228) 2021-06-01 15:23:14 +02:00
Gerhard Schlager ae744693d8 FIX: TL2 promotion message from discobot didn't use user locale
Includes a small refactor/fix, because `return` isn't allowed in blocks.
2021-05-31 10:26:36 +08:00
Krzysztof Kotlarek 942b9126a1
FIX: no error when double save post with poll (#13111)
Some plugins hook into Post after save to set custom fields and save again.

For example: https://github.com/discourse/discourse-category-experts/blob/main/lib/category_experts/post_handler.rb#L27

Problem is that in case like that `raw_changed?` is false but all callback are triggered. `extracted_polls` is class atribute therefore that should be reset with each attempt.

That was causing an error:
```
#<ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint 
"index_polls_on_post_id_and_name" DETAIL:  Key (post_id, name)=(8967, poll) already exists.
```
2021-05-27 08:39:51 +10:00
Bianca Nenciu 8e1448487f
FIX: Make poll options tabbable (#13159) 2021-05-26 20:45:10 +03:00
Arpit Jalan 283b08d45f
DEV: Absorb onebox gem into core (#12979)
* Move onebox gem in core library

* Update template file path

* Remove warning for onebox gem caching

* Remove onebox version file

* Remove onebox gem

* Add sanitize gem

* Require onebox library in lazy-yt plugin

* Remove onebox web specific code

This code was used in standalone onebox Sinatra application

* Merge Discourse specific AllowlistedGenericOnebox engine in core

* Fix onebox engine filenames to match class name casing

* Move onebox specs from gem into core

* DEV: Rename `response` helper to `onebox_response`

Fixes a naming collision.

* Require rails_helper

* Don't use `before/after(:all)`

* Whitespace

* Remove fakeweb

* Remove poor unit tests

* DEV: Re-add fakeweb, plugins are using it

* Move onebox helpers

* Stub Instagram API

* FIX: Follow additional redirect status codes (#476)

Don’t throw errors if we encounter 303, 307 or 308 HTTP status codes in responses

* Remove an empty file

* DEV: Update the license file

Using the copy from https://choosealicense.com/licenses/gpl-2.0/#

Hopefully this will enable GitHub to show the license UI?

* DEV: Update embedded copyrights

* DEV: Add Onebox copyright notice

* DEV: Add MIT license, convert COPYRIGHT.txt to md

* DEV: Remove an incorrect copyright claim

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: jbrw <jamie@goatforce5.org>
2021-05-26 15:11:35 +05:30
David Taylor 8c83803109
DEV: Remove unused `disabled_plugins` checks (#13144)
We now bundle Javascript for each theme/plugin separately, and only ship bundles for enabled plugins to the client. Therefore, these disabled_plugins checks are now redundant, and can be removed.
2021-05-26 09:44:58 +10:00
Justin DiRose a363f47798
UX: Make discobot flag tutorial copy clearer (#13148)
Per https://meta.discourse.org/t/-/186896, this is a simple copy change to help curb users from sending messages to the moderators via flagging the Discobot tutorial.
2021-05-25 15:34:38 -05:00
Discourse Translator Bot e2e13a70f6
Update translations (#13136) 2021-05-25 15:29:11 +02:00
Jeff Atwood 50926f6143
FIX: Simplify post and topic deletion language (#13128)
Based on feedback from Matt Haughey, we don't need to use so many words when describing a deleted topic or post.

Co-authored-by: Martin Brennan <martin@discourse.org>
2021-05-25 12:04:10 +10:00
Josh Soref 59097b207f
DEV: Correct typos and spelling mistakes (#12812)
Over the years we accrued many spelling mistakes in the code base. 

This PR attempts to fix spelling mistakes and typos in all areas of the code that are extremely safe to change 

- comments
- test descriptions
- other low risk areas
2021-05-21 11:43:47 +10:00
Discourse Translator Bot 55611a5b80
Update translations (#13089) 2021-05-18 16:49:18 +02:00
Discourse Translator Bot 8ac184c636
Update translations (#13088) 2021-05-18 15:11:41 +02:00
Penar Musaraj b21f74060e
FIX: Layout of date input in poll builder (#13057) 2021-05-13 10:27:03 -04:00
Martin Brennan b690e7787e
FIX: Missing iframe closing tag in discobot certificate (#13052)
When issuing the discobot certificate, we were not closing the
iframe tag, which meant that the final message instruction to
the user was swallowed up.
2021-05-13 15:51:12 +10:00
Penar Musaraj f9bb6399e0
DEV: Remove SCSS color vars fallbacks (#13035)
They are no longer needed.
2021-05-12 08:56:15 -04:00
Discourse Translator Bot 21c301aa72
Update translations (#13030) 2021-05-11 19:01:59 +02:00
Jeff Wong f337d59ed9
FIX: access to styleguide in subfolder install (#12995) 2021-05-08 17:08:12 -07:00
Kris f002c58a30
DEV: Buttons were missing btn-default classes (#12991) 2021-05-08 11:45:18 -04:00
Penar Musaraj 116ae8ebc1
DEV: update styleguide guidance for colors and font sizes (#12975) 2021-05-07 09:30:27 -04:00
Bianca Nenciu 05ac4f4091
FIX: Do not try to show logo if it does not exist (#12968)
The generator tried to include the logo in the certificate, even when
it did not exist and that caused a server error.
2021-05-06 19:09:04 +03:00
Discourse Translator Bot d45c7973f9
Update translations (#12940) 2021-05-04 16:34:37 +02:00
Bianca Nenciu 8636292a40
FIX: Do not cut off long polls (#12854)
Some polls with images can be very long. Those which showed a pie chart
for the results had a fixed height set, which meant that some long polls
could be cut off.
2021-04-29 10:32:45 +03:00
Discourse Translator Bot 3b2f2b533f
Update translations (#12851) 2021-04-27 16:01:06 +02:00
Joffrey JAFFEUX d53307b141
UX: correctly shows outline around focused input time (#12833) 2021-04-26 11:05:46 +02:00
Robin Ward e3b1d1a718
DEV: Improve Ember CLI's bootstrap logic (#12792)
* DEV: Give a nicer error when `--proxy` argument is missing

* DEV: Improve Ember CLI's bootstrap logic

Instead of having Ember CLI know which URLs to proxy or not, have it try
the URL with a special header `HTTP_X_DISCOURSE_EMBER_CLI`. If present,
and Discourse thinks we should bootstrap the application, it will
instead stop rendering and return a HTTP HEAD with a response header
telling Ember CLI to bootstrap.

In other words, any time Rails would otherwise serve up the HTML for the
Ember app, it stops and says "no, you do it."

* DEV: Support asset filters by path using a new options object

Without this, Ember CLI's bootstrap would not get the assets it wants
because the path it was requesting was different than the browser path.
This adds an optional request header to fix it.

So far this is only used by the styleguide.
2021-04-23 10:24:42 -04:00
Bianca Nenciu a97e3e249d
FEATURE: Show a textarea in advanced mode (#12806)
When switching to advanced mode, show a textarea instead of individual
inputs. Every line of the textarea is equivalent with an input.
2021-04-23 16:54:53 +03:00
Kris 984d87f30c
UX: stop presence indicator hop, space consistency (#12797) 2021-04-22 16:11:47 -04:00
Bianca Nenciu 6c5d6dd356
Improve validation for polls and improve builder (#12745)
* FIX: Show date picker over modal

Previously, scrolling was necessary to see the whole picker.

* FEATURE: Improve validation for polls

Adds new error messages for each of the edge cases. Previously, it
failed with a simple error saying that the minimum value must be less
than the maximum value.

* UX: Copy edit
2021-04-22 21:36:32 +03:00
Discourse Translator Bot 606860e75a
Update translations (#12764) 2021-04-20 15:33:17 +02:00
Bianca Nenciu 96a16123d8
FIX: Generate unique HTML heading names (#12705)
Headings with the exact same name generated exactly the same heading
names, which was invalid. This replaces the old code for generating
names for non-English headings which were using URI encode and resulted
in unreadable headings.
2021-04-16 10:54:19 +03:00
Dan Ungureanu 528cfea079
FEATURE: Auto-activate users invited by email (#12675)
When invited by email, users will receive an invite URL which contains
a token. If that token is present when the invite is redeemed, their
account will be automatically activated.
2021-04-14 12:15:56 +03:00
Discourse Translator Bot 27eff709c4
Update translations (#12684) 2021-04-13 16:02:08 +02:00
Bianca Nenciu 2081b6e5c9
UX: Improve poll builder UI (#12549)
* Improve poll validation

* Redesign poll builder

* Group all advanced settings under a new section
2021-04-12 19:48:01 +03:00
jbrw 817b6c24c8
DEV: lazy-yt plugin should attempt to use `parse_embed_response` (#12626)
This requires the `parse_embed_response` method, which should be available in the `onebox` gem, version 2.2.11 (or thereabouts).
2021-04-07 12:29:39 -04:00
Discourse Translator Bot 93f74add7d
Update translations (#12614) 2021-04-07 11:58:41 +02:00
tshenry c672ee282a
Improve details_enabled site setting description copy (#12560)
The `details_enabled` site setting description did not clearly convey what it controls.

The copy change was discussed here: https://meta.discourse.org/t/183923
2021-03-30 13:51:12 -07:00
Discourse Translator Bot 598718a19d
Update translations (#12556) 2021-03-30 15:44:13 +02:00
Roman Rizzi 87b5d16c10
UX: Let users know they disabled discobot and they can't interact with it. (#12534)
Discobot will reply to users they need to enable onboarding tips to interact with them when issued a command.
2021-03-29 14:21:30 -03:00
Arpit Jalan edcb5f77da
FIX: remove @discobot likes feature on public topics (#12522)
https://meta.discourse.org/t/discobot-is-breaking-the-meaning-of-likes-on-my-community/183804/8?u=techapj
2021-03-25 18:23:55 +05:30
Discourse Translator Bot e477a9a47d
Update translations (#12490) 2021-03-23 16:12:04 +01:00
Bianca Nenciu 2ad9b3f432
FEATURE: Add anchor links to headings (#12379) 2021-03-23 10:45:06 +02:00
Bianca Nenciu 6eab1e83c3
FIX: Do not fail if Postgres is not available (#12440)
Follow-up to 50f8782def.
2021-03-19 12:07:39 +02:00
Bianca Nenciu 50f8782def
FIX: Fix narrative bot settings in multisites (#12380)
after_initialize is not called for each multisite database, but just
for first (default) database.
2021-03-17 17:41:31 +02:00
Discourse Translator Bot bc88ea5976
Update translations (#12412) 2021-03-16 15:49:29 +01:00
Discourse Translator Bot d1cf773730
Update translations (#12323) 2021-03-09 15:19:02 +01:00
Discourse Translator Bot c21cba70f6
Update translations (#12258) 2021-03-02 15:28:30 +01:00
Penar Musaraj 45c5fd2172
DEV: Remove JoyPixels emoji option (#12197)
- removes the option from site settings
- deletes the site setting on existing sites that have it
- marks posts using emojis as requiring a rebake

Note that the actual image files are not removed here, the plan is to
remove them in a few weeks/months (when presumably the rebaking of old
posts has been completed).
2021-02-26 07:44:52 -05:00
Osama Sayegh bd709c89a7
FIX: Unsubscribe from topic presence when navigating between topics (#12198)
This PR fixes a bug where if you navigate from topic to another one (via suggested topics, notifications etc.), the previous topic is not unsubscribed from presence manager, which means if you visit lots of topics all the subscriptions will accumulate and can cause rate limit errors.

This bug is exposed by the loading slider we're currently experimenting with on Meta because we no longer have an intermediate state when navigating between topics which means the `willDestroyElement` hook that's responsible for unsubscribing is not called.
2021-02-24 23:14:38 +03:00
Discourse Translator Bot 2757003ef1
Update translations (#12186) 2021-02-23 15:10:04 +01:00
David Taylor 1844bde57c
FIX: Allow mobile-nav to work without loading transitions (#12184)
Previously, the `{{mobile-nav}}` component required a `currentRouteName` property, passed from the router service. It would observe changes in this property, and update the UI accordingly.

If we change between routes which have the same `currentRouteName` (e.g. two different group message inboxes), then the `currentRouteName` does not change and does not trigger the observer. Currently in core, we are relying on the fact that currentRouteName temporarily enters a `.loading` substate during a transition. This will change when we remove the loading substate in the near future.

This commit refactors `{{mobile-nav}}` to inject the router directly, and use the `routeDidChange` event instead of an observer. The change is backwards compatible, but plugins passing the old `currentPath` property will be shown a deprecation notice.
2021-02-23 11:16:40 +00:00
Discourse Translator Bot f283bde25a
Update translations (#12097) 2021-02-16 15:24:37 +01:00
Penar Musaraj 5d8673321f
DEV: Add poll:voted event (#12070) 2021-02-12 13:06:27 -05:00