Commit Graph

240 Commits

Author SHA1 Message Date
Joffrey JAFFEUX
fd15562939
FIX: allows to use open attribute with details (#29116)
Supporting `open` allows to show a `details` block open by default.

Usage:

```
[details open]
my visible content
[/details]
```
2024-10-08 11:13:44 +09:00
Régis Hanol
3927b27f34 FIX: allow quote-less details BBCode
In 53b3d2f0dc we introduced a stricter BBCode Tag parser. It prevents having "values" with spaces when they're not surrounded by a valid pair of quotes.

The `[details=` BBCode Tag is popular enough that it's worth adding a special case for it (especially since it doesn't support other parameters).

This also adds the Finnish pair of quotes.

Context - https://meta.discourse.org/t/details-accepts-only-one-word-as-summary/313019
2024-06-24 14:16:36 +02:00
Discourse Translator Bot
9d8044a2ee
FEATURE: Add Uyghur language (#27183)
Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2024-05-27 09:58:18 +02:00
Régis Hanol
d4af30f26d FIX: elided content in email should always have an href
Not 100% sure why the changes in `PrettyText.format_for_email` raised this issue, but we were missing adding a link to the Discourse instance whenever we are replacing the elided part of a post with a link to either the post or the Discourse instance in the email.

Also reformated the specs using better variable names (sometimes a variable named `md` would contain some html) and used the `match_html` helper for all the tests.
2024-05-22 15:38:18 +02:00
Régis Hanol
4b043a2a82 DEV: refactor morphed preview specs 2024-04-10 10:36:20 +02:00
Régis Hanol
377d2ca3ad
FIX: keep details open in preview (#26518)
when morphing is enabled, details elements in the preview will be kept open
2024-04-04 18:43:25 +02:00
Jarek Radosz
4c860995e0
DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00
Martin Brennan
4e7a75a7ec
DEV: Single admin plugin page for consistent admin plugin UX (#26024)
This commit adds new plugin show routes (`/admin/plugins/:plugin_id`) as we move
towards every plugin having a consistent UI/landing page.

As part of this, we are introducing a consistent way for plugins
to show an inner sidebar in their config page, via a new plugin
API `register_admin_config_nav_routes`

This accepts an array of links with a label/text, and an
ember route. Once this commit is merged we can start the process
of conforming other plugins to follow this pattern, as well
as supporting a single-page version of this for simpler plugins
that don't require an inner sidebar.

Part of /t/122841 internally
2024-03-13 13:15:12 +10:00
Discourse Translator Bot
8eab06cb2f
Update translations (#25659) 2024-02-13 16:11:30 +01:00
Discourse Translator Bot
50f8a51923
Update translations (#25278) 2024-01-16 14:54:32 +01:00
Discourse Translator Bot
2e0ec679c5
Update translations (#25185) 2024-01-09 15:09:36 +01:00
chapoi
3d710fa0b8
UX:; scope details change (#24715) 2023-12-05 13:56:17 +01:00
chapoi
707acbe696
UX: details tag background colour (#24710) 2023-12-05 12:52:00 +01:00
Jarek Radosz
916e1371b3
DEV: Fix "ember/no-global-jquery" lint (#24586) 2023-11-28 10:53:38 +01:00
Godfrey Chan
9a1695ccc1
DEV: remove markdown-it-bundle and custom build code (#23859)
With Embroider, we can rely on async `import()` to do the splitting
for us.

This commit extracts from `pretty-text` all the parts that are
meant to be loaded async into a new `discourse-markdown-it` package
that is also a V2 addon (meaning that all files are presumed unused
until they are imported, aka "static").

Mostly I tried to keep the very discourse specific stuff (accessing
site settings and loading plugin features) inside discourse proper,
while the new package aims to have some resembalance of a general
purpose library, a MarkdownIt++ if you will. It is far from perfect
because of how all the "options" stuff work but I think it's a good
start for more refactorings (clearing up the interfaces) to happen
later.

With this, pretty-text and app/lib/text are mostly a kitchen sink
of loosely related text processing utilities.

After the refactor, a lot more code related to setting up the
engine are now loaded lazily, which should be a pretty nice win. I
also noticed that we are currently pulling in the `xss` library at
initial load to power the "sanitize" stuff, but I suspect with a
similar refactoring effort those usages can be removed too. (See
also #23790).

This PR does not attempt to fix the sanitize issue, but I think it
sets things up on the right trajectory for that to happen later.

Co-authored-by: David Taylor <david@taylorhq.com>
2023-11-06 16:59:49 +00:00
Godfrey Chan
c34f8b65cb
DEV: Rename I18n imports to discourse-i18n (#23915)
As of #23867 this is now a real package, so updating the imports to
use the real package name, rather than relying on the alias. The
name change in the package name is because `I18n` is not a valid
name as NPM packages must be all lowercase.

This commit also introduces an eslint rule to prevent importing from
the old I18n path.

For themes/plugins, the old 'i18n' name remains functional.
2023-10-18 11:07:09 +01:00
David Taylor
48193767bf DEV: Sort imports
Automatically generated by `eslint --fix` to satisfy the updated configuration
2023-10-10 21:46:54 +01:00
Alan Guo Xiang Tan
913fd3a7b3
DEV: Improve addToolbarPopupMenuOptionsCallback plugin api (#23769)
Why this change?

Previously just using the `addToolbarPopupMenuOptionsCallback` plugin
API itself was insufficient because it required the return object to
include an `action` key which only accepted a name of the action
function as a string. This was highly problematic because the action
function had to be defined on the `composer` service which means using
the `modifyClass` API to add the action function. This made the API
awkward to use leading to poor developer experiencec.

What does this change do?

This commit introduces a couple of improvemnts to the API.

1. First the API has been renamed to `addComposerToolbarPopupMenuOption` because
   the API no longer accepts a callback function which was quite
   redundant. Instead, it now accepts an Object. The
   `addToolbarPopupMenuOptionsCallback` API function is deprecated and
   will be dropped in Discourse 3.3. Note that passing the API a
   function is still supported but will be dropped when the `addToolbarPopupMenuOptionsCallback`
   is removed.

2. The `action` key in the Object passed to the function can now be a
   function and is passed the `toolbarEvent` object when called.

3. The `condition` on key in the Object passed to the function can now be a
   function and is passed the `composer` service when called.
2023-10-06 07:43:40 +08:00
Martin Brennan
97a812f022
FIX: Hide core plugins from the admin Plugins list (#23328)
Most of the core plugins were already hidden, this hides
chat, styleguide, and checklist to avoid potential confusion
for end users.

Also removes respond_to? :hide_plugin, since that API has been
in place for a while now.
2023-08-31 10:01:01 +10:00
Discourse Translator Bot
23222aa2d4
Update translations (#23099) 2023-08-15 21:24:57 +02:00
Discourse Translator Bot
a909dffe8f
Update translations (#22300) 2023-06-27 16:39:27 +02:00
Discourse Translator Bot
791630f08b
Update translations (#21583) 2023-05-16 19:40:01 +02:00
Discourse Translator Bot
9a562f54d7
Update translations (#21055) 2023-04-11 15:45:03 +02:00
Discourse Translator Bot
4cf065c480
Update translations (#20671) 2023-03-14 15:04:54 +01:00
Discourse Translator Bot
1f88354c5e
Update translations (#20559) 2023-03-07 14:58:31 +01:00
David Taylor
055310cea4
DEV: Apply syntax_tree formatting to plugins/* 2023-01-07 11:11:37 +00:00
Discourse Translator Bot
58ffa06d4a
Update translations (#19340) 2022-12-06 16:22:23 +01:00
Discourse Translator Bot
2eee6fb644
Update translations (#19150) 2022-11-22 15:01:19 +01:00
Discourse Translator Bot
d7844a797f
Update translations (#18948) 2022-11-09 00:00:28 +01:00
Martin Brennan
ac7bf98ad1
DEV: Load client site settings YML into JS tests (#18413)
Our method of loading a subset of client settings into tests via
tests/helpers/site-settings.js can be improved upon. Currently we have a
hardcoded subset of the client settings, which may get out of date and not have
the correct defaults. As well as this plugins do not get their settings into the
tests, so whenever you need a setting from a plugin, even if it has a default,
you have to do needs.setting({ ... }) which is inconvenient.

This commit introduces an ember CLI build step to take the site_settings.yml and
all the plugin settings.yml files, pull out the client settings, and dump them
into a variable in a single JS file we can load in our tests, so we have the
correct selection of settings and default values in our JS tests. It also fixes
many, many tests that were operating under incorrect assumptions or old
settings.

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2022-11-08 09:17:43 +10:00
Discourse Translator Bot
5f02f11acc
Update translations (#18740) 2022-10-25 17:00:49 +02:00
Discourse Translator Bot
0af2837b73
Update translations (#18642) 2022-10-19 15:19:28 +02:00
Phil Pirozhkov
493d437e79
Add RSpec 4 compatibility (#17652)
* Remove outdated option

04078317ba

* Use the non-globally exposed RSpec syntax

https://github.com/rspec/rspec-core/pull/2803

* Use the non-globally exposed RSpec syntax, cont

https://github.com/rspec/rspec-core/pull/2803

* Comply to strict predicate matchers

See:
 - https://github.com/rspec/rspec-expectations/pull/1195
 - https://github.com/rspec/rspec-expectations/pull/1196
 - https://github.com/rspec/rspec-expectations/pull/1277
2022-07-28 10:27:38 +08:00
Jarek Radosz
7b6cd44c32
DEV: Remove most of jQuery usage from tests (#17474) 2022-07-13 19:29:19 +02:00
Jarek Radosz
624c684d51
DEV: Transpile all plugin js by default (#17175)
Goodbye `# transpile_js: true`? 🙂
2022-06-21 22:07:10 +02:00
Jarek Radosz
ba2c7b8f35
DEV: Use the block form of module() (#17151) 2022-06-20 15:42:10 +02:00
Discourse Translator Bot
7ac485fb9f
FEATURE: Add Croatian language (#17130)
Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2022-06-18 00:18:22 +02:00
Discourse Translator Bot
fe689115d4
Update translations (#16378) 2022-04-05 15:28:19 +02:00
Discourse Translator Bot
216dfbb895
Update translations (#16314) 2022-03-30 14:52:59 +02:00
Jarek Radosz
2fc70c5572
DEV: Correctly tag heredocs (#16061)
This allows text editors to use correct syntax coloring for the heredoc sections.

Heredoc tag names we use:

languages: SQL, JS, RUBY, LUA, HTML, CSS, SCSS, SH, HBS, XML, YAML/YML, MF, ICS
other: MD, TEXT/TXT, RAW, EMAIL
2022-02-28 20:50:55 +01:00
Discourse Translator Bot
c665003203
Update translations (#15416) 2021-12-28 14:13:58 +01:00
Discourse Translator Bot
4afd6f0189
Update translations (#15292) 2021-12-14 14:53:35 +01:00
Jarek Radosz
906a71a607
DEV: Fix linting issues in core plugins (#14916) 2021-11-13 15:31:42 +01:00
Jarek Radosz
f414d5eace
DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
Jarek Radosz
4ad77f3382
DEV: Remove .es6 extensions from core (#14912)
Still supported in plugins though.
2021-11-13 12:51:53 +01:00
Jarek Radosz
d162229758
DEV: Replace equal() with strictEqual() (#14827) 2021-11-08 10:26:28 +01:00
Discourse Translator Bot
b44119cdb2
Update translations (#14579) 2021-10-12 16:00:22 +02:00
Discourse Translator Bot
0f5d737a61
Update translations (#14513) 2021-10-05 15:59:26 +02: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