Commit Graph

442 Commits

Author SHA1 Message Date
98fa42f2e2 DEV: Move discourse-common/config/environment to discourse/lib (#30738) 2025-01-13 15:29:26 +00:00
0ed4b09527 DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733)
`discourse-common` was created in the past to share logic between the
'wizard' app and the main 'discourse' app. Since then, the wizard has
been consolidated into the main app, so the separation of
`discourse-common` is no longer useful.

This commit moves `discourse-common/(lib|utils)/*` into
`discourse/lib/*`, adds shims for the imports, and updates existing
uses in core.
2025-01-13 13:02:49 +00:00
1d7b1e587a Update translations 2025-01-07 21:56:56 +01:00
8f6c99df8c DEV: Run prettier correctly for bundled-plugin test directories (#30338) 2024-12-18 12:02:28 +00:00
85691a7f31 DEV: refactor composer-editor/d-editor, a little more (#29973)
Adds setupEditor to ComposerEditor so it can setup/destroy events when the underlying editorComponent is switched.

Moves putCursorAtEnd uses (which implementation is textarea-specific) to TextareaTextManipulation.

Moves insertCurrentTime and a corresponding test, which is discourse-local-dates specific, to the plugin.

Moves applyList and formatCode from DEditor to the TextareaTextManipulation.

Moves DEditor._applySurround to TextareaTextManipulation.applySurroundSelection

Avoids resetting the textarea value on applyList and formatCode, keeping the undo history.
2024-12-02 18:24:14 -03:00
6e4baaf092 DEV: Use qunit-dom's hasValue wherever possible (#30018) 2024-12-01 20:37:24 +01:00
ef7518d4ad DEV: Fix no-loose-assertions lint (#29965)
and enable some of qunit lints
2024-11-28 11:22:27 +01:00
b9f183e2c3 Update translations (#29934) 2024-11-26 23:14:56 +01:00
32665cf9dd DEV: Consolidate i18n import paths (#29804)
Enables our new eslint rules which enforce consistent i18n imports. For more info, see 0d58b40cd7
2024-11-19 20:45:18 +00:00
57f4176b57 DEV: Bump rubocop_discourse (#29608) 2024-11-06 06:27:49 +08:00
6459ab9320 UX: allow anon users to download calendar (#29551)
Allows anonymous users to download the calendar file. Before, they were given the option, but it would fail silently with a `TypeError: Cannot read properties of null (reading 'user_option')`.
2024-11-04 12:35:45 -03:00
380974ce00 DEV: Use hasAttribute/hasAria/hasStyle in tests (#29568) 2024-11-04 11:30:38 +01:00
9694d2477a DEV: Convert more notOk assertions (#29556)
…to either qunit-dom or `strictEqual`
2024-11-04 10:27:30 +01:00
b81055a6d4 DEV: Convert more equal assertions (#29554)
…to either qunit-dom or `strictEqual`
2024-11-03 21:04:38 +01:00
688f65a39d DEV: Convert more test assertions to qunit-dom (#29214)
the PR is sponsored by vscode's regex support in find-and-replace 😉
2024-10-15 17:11:20 +02:00
29ac39cf41 DEV: Extract a test helper in local-dates (#29196) 2024-10-15 10:27:42 +02:00
76ad581f67 Update translations 2024-10-02 08:55:44 +02:00
a914d3230b DEV: remap all core icons for fontawesome 6 upgrade (#28715)
Followup to 7d8974d02f7360b324b446868463e950fe92883f

Co-authored-by: David Taylor <david@taylorhq.com>
2024-09-13 16:50:52 +01:00
7d8974d02f UX: Upgrade to fontawesome 6.6.0 (#28778)
This upgrade is designed to be fully backwards-compatible. Any icon names which have changed will be automatically remapped to the new name. For now, this will happen silently. In future, once core & official themes/plugins have been updated, we will start raising deprecation errors to help theme/plugin authors update their code.

Extracted from https://github.com/discourse/discourse/pull/28715

Announcement at https://meta.discourse.org/t/were-upgrading-our-icons-to-font-awesome-6/325349

Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
2024-09-09 14:40:56 +01:00
348abeecb1 DEV: Use icon-rendering API for local-dates (#28788)
This makes local-dates compatible with the fa6 upgrade in https://github.com/discourse/discourse/pull/28778
2024-09-06 20:51:57 +01:00
583c932173 DEV: Refactor complex initializers into classes (#28661)
We're working to remove all decorators from object-literal-properties. This commit refactors all initializers which were using these decorators into classes, where decorators are allowed. Also adds cleanup logic to the local-dates initializer, which was previously missing.
2024-09-02 10:08:07 +01:00
a2cab9a342 DEV: Update remaining core plugin components to native-class syntax (#28611)
Changes made using the ember-native-class-codemod, plus some manual tweaks
2024-08-29 12:16:52 +01:00
c17fab873d UX: remove whitespace from rendered localdate (#27952) 2024-07-17 09:48:28 -04:00
53b3d2f0dc FIX: BBCode tag parser
Wasn't quite handling the cases where a closing bracket `]` was used in the value of one of the attributes.

```markdown
[chat quote=user channel="[broken]"]
```

Would not be correctly parsed because we would _greedily_ use the first `]` as the end of the tag even though it might be a valid character when inside proper quotes.

c39a4de139/app/assets/javascripts/discourse-markdown-it/src/features/bbcode-block.js (L62)

Re-wrote the `parseBBCodeTag` to properly handle the following cases

- A closing tag (aka `[/name]`) which are easy since they don't have any attributes
- An old `[quote=...]` format we used that doesn't uses quotes but still has various attributes of the form `key:value`
- All three valid BBCode opening tag formats we support
  - `[name]` without any attributes
  - `[name=foo]` with a default value
  - `[name foo=bar]` with some attributes

Ended up having to fix/rewrite the few bbcode rules that were using the `parseBBCodeTag` function, namely `d-wrap` and `discourse-local-dates`.

While working on this, I think I also found a way to get rid the of shims we had in place so that plugins could use the `parseBBCodeTag` function.

Reference - https://meta.discourse.org/t/having-a-right-bracket-in-a-channel-name-breaks-all-quotes-from-that-channel/308439
2024-06-18 10:47:18 +02:00
dfad95058d UX: allow cooked local-dates to wrap (#27404) 2024-06-10 17:22:30 -04:00
9d8044a2ee FEATURE: Add Uyghur language (#27183)
Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2024-05-27 09:58:18 +02:00
e579cfc08f DEV: Avoid using the old action helper (#26935) 2024-05-08 20:26:48 +02:00
fe16633a0c DEV: allows for multiple menus/tooltips (#26823)
menus and tooltips are now appended to their own portals. The service are the only responsible for managing the instances, prior to this commit, services could manage one instance, but the DMenu and DTooltip components could also take over which could cause unexpected states.

This change also allows nested menus/tooltips.

Other notable changes:

- few months ago core copied the CloseOnClickOutside modifier of float-kit without removing the float-kit one, this commit now only use the core one.
- the close function is now trully async
- the close function accepts an instance or an identifier as parameter
2024-05-07 23:48:44 +02:00
36659531f7 FIX: ensure [date-range don't clashes with checklist
Adding the "→" was not setting the proper token nesting hierarchy.
2024-04-08 08:22:21 +02:00
67a8080e33 FEATURE: Redesigned bookmark modal and menu (#23071)
Adds the new quick menu for bookmarking. When you bookmark
a post (chat message behaviour will come later) we show this new quick
menu and bookmark the item straight away.

You can then choose a reminder quick option, or choose Custom... to open
the old modal. If you click on an existing bookmark, we show the same quick menu
but with Edit and Delete options.

A later PR will introduce a new bookmark modal, but for now we
are using the old modal for Edit and Custom... options.
2024-04-05 09:25:30 +10:00
7f3f07dd40 FIX: missing IST KST and JST timezones in cooked posts (#26252)
In this PR we introduced 3 new timezones to UX - IST, KST and JST

cb2569303f

However, the same has to be done in PrettyText so cooked posts respect those timezones.
2024-03-20 11:28:45 +11:00
11099434b5 DEV: Clean up mobileView/desktopView uses (#26229)
Inspired by a piece of "do not do x if it's not a mobile view" code 🙃
2024-03-18 23:29:42 +01:00
ec3d29a1fa Update translations (#26136) 2024-03-12 15:40:11 +01:00
147e5563fb DEV: Update moment and moment-timezone (#26089)
* Bump the moment-timezone version in package.json
* update yarn lock
* bump moment
* bin/rails javascript:update
* npx yarn-deduplicate
* update the spec (not sure which tz changed exactly but there's a 1 hour difference now for year 2018 and earlier 🤷‍♂️)

---------

Co-authored-by: Anton Morgunov <45741336+anmorgunov@users.noreply.github.com>
Co-authored-by: Anton Morgunov <anton@ischemist.com>
2024-03-11 03:04:51 +01:00
5d90332cfc DEV: Use the "new" service import (#26059) 2024-03-06 18:05:11 +01:00
11067c73d0 DEV: Use fn+mut instead of action+mut (#26057)
One step closer to removing all `action` helper usage
2024-03-06 18:05:03 +01:00
f7d7092a7a DEV: Update rubocop-discourse to latest version
The lastest version of rubocop-discourse enables rules regarding
plugins.
2024-03-04 15:08:35 +01:00
eea7af09fd Update translations (#25914) 2024-02-27 20:50:30 +01:00
6b185f8655 PERF: eliminate some slow CSS selectors (#25392) 2024-01-26 13:10:45 -05:00
50f8a51923 Update translations (#25278) 2024-01-16 14:54:32 +01:00
2e0ec679c5 Update translations (#25185) 2024-01-09 15:09:36 +01:00
294febf3c4 DEV: Convert min_trust_to_flag_posts setting to groups (#24864)
We're changing the implementation of trust levels to use groups. Part of this is to have site settings that reference trust levels use groups instead. It converts the min_trust_to_flag_posts site setting to flag_post_allowed_groups.

Note: In the original setting, "posts" is plural. I have changed this to "post" singular in the new setting to match others.
2023-12-13 17:18:42 +08:00
7d0562f10e Update translations (#24848) 2023-12-12 14:23:51 +01:00
41942357ed DEV: Use class attribute instead of @class arg (#24804) 2023-12-12 13:09:05 +01:00
7e013b2120 DEV: add recurrence rule parameter to downloadCalendar API (#24404)
Add option to create recurrent calendar events. Recurrence rule parameter follows rfc5545 specification: https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.10
2023-11-30 13:56:22 +11:00
0b352ce7fb UX: fix date time modal on mobile (#24531)
* UX: fix date time modal
2023-11-24 10:28:46 +01:00
e34d2cfde4 DEV: Remove unnecessary fab! blocks (#24419) 2023-11-16 13:22:08 -05:00
f08e5c897e UX: Apply decorators to small action posts (#24397) 2023-11-16 08:52:07 -05:00
6e161d3e75 DEV: Allow fab! without block (#24314)
The most common thing that we do with fab! is:

    fab!(:thing) { Fabricate(:thing) }

This commit adds a shorthand for this which is just simply:

    fab!(:thing)

i.e. If you omit the block, then, by default, you'll get a `Fabricate`d object using the fabricator of the same name.
2023-11-09 16:47:59 -06:00
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