Commit Graph

28016 Commits

Author SHA1 Message Date
Andrei Prigorshnev 0fe111e492
FEATURE: add user status to user preferences (#18532) 2022-10-12 23:35:25 +04:00
Isaac Janzen 231dc10bbd
Add replaceContent selectKit modifier (#18569)
Add the ability to modify a selectKit's content with `replaceContent`

Eg.

```
      api.modifySelectKit("combo-box").replaceContent(() => {
        return {
          id: "foo",
          name: "Foo",
        };
      });
```

will override existing content to only include the passed object
2022-10-12 13:38:42 -05:00
Penar Musaraj d7c5a7033d
A11Y: Make "Load parent post" element accessible (#18568) 2022-10-12 14:35:31 -04:00
Blake Erickson efb116d2bd
FIX: Reset related site settings on general category delete (#18548)
* FIX: Reset related site settings on general category delete

If the new seeded General category is deleted we also need to delete the
corresponding site setting for it so that we don't try and reference it.

This fixes a bug in the category dropdown composer.

This change creates the `clear_related_site_settings` after destroy
hook that could also be used by other features in the future, like maybe
when we have a `default_category_id` site_setting.

Looks like if `nil` out a site setting it is set to `0`?

```
[9] pry(main)> SiteSetting.general_category_id = nil
  SiteSetting Load (0.4ms)  SELECT "site_settings".* FROM "site_settings" WHERE "site_settings"."name" = 'general_category_id' LIMIT 1
=> nil
[10] pry(main)> SiteSetting.general_category_id
=> 0
```

That is why the tests check if the value is `< 1` and not `nil`.

* Use -1 instead of nil because it is the default
2022-10-12 11:09:45 -06:00
chapoi da9ce77ffd
UX: danger colour update (#18516)
* UX: danger colour update

* Update test
2022-10-12 19:01:01 +02:00
Andrei Prigorshnev 98620f8e0e
FIX: status emoji was shown on the left on mobile (#18567) 2022-10-12 20:54:24 +04:00
Andrei Prigorshnev c32ab70111
FIX: alignment of user status emoji on posts (#18563) 2022-10-12 20:07:07 +04:00
Bianca Nenciu 7611fec0da
FEATURE: Implement new onboarding popups (#18362)
This commit introduces a new framework for building user tutorials as
popups using the Tippy JS library. Currently, the new framework is used
to replace the old notification spotlight and tips and show a new one
related to the topic timeline.

All popups follow the same structure and have a title, a description and
two buttons for either dismissing just the current tip or all of them
at once.

The state of all seen popups is stored in a user option. Updating
skip_new_user_tips will automatically update the list of seen popups
accordingly.
2022-10-12 18:38:45 +03:00
Osama Sayegh 1eaa1fee2d
DEV: Merge mentions and watching tabs into the replies tab in the user menu (#18544)
This commit merges the mentions and "watching" tabs into the replies tab of the user menu. This change is kind of experimental, so we may change it back either fully or partially. Internal topic: t/76474.
2022-10-12 17:58:17 +03:00
David Taylor 76c86a4269
FIX: Correctly handle HTTP errors during dominant color calculation (#18565)
The previous fix in e83d35d6 was incorrect, and the stub in the test was never actually hit. This commit moves the error handling to the right place and updates the specs to ensure the stub is always used.
2022-10-12 15:50:44 +01:00
chapoi 899ed039b7
FIX: typo (#18566) 2022-10-12 16:50:02 +02:00
Jarek Radosz 67e422c2d4
DEV: Remove noop CSS (#18564)
The lint warnings were:

```
inline-block is ignored due to the float. If 'float' has a value other than 'none', the box is floated and 'display' is treated as 'block'

scss(propertyIgnoredDueToDisplay)
```
2022-10-12 16:35:51 +02:00
Jarek Radosz 4170b9bb58
DEV: Use more css vars (#18561)
Followup to #18518

This time it's mostly line-height vars and a couple of other uncommon vars.
2022-10-12 16:05:42 +02:00
Jarek Radosz ea326906e3
DEV: Use css var font sizes (#18518)
For consistency and and the ability to change all font sizes at once in the dev tools
2022-10-12 15:31:59 +02:00
Bianca Nenciu 33087f0bdf
A11Y: Set role=presentation if alt attr is missing (#18546)
This applies to all images posted that do not have a user description.
2022-10-12 14:07:37 +03:00
David Taylor c707ee714d
DEV: Use npm for forked backburner.js version (#18559)
Using a git-sourced package seems to cause intermittent `yarn install` failures.

Followup to ad37c6c017
2022-10-12 11:14:41 +01:00
David Taylor ad37c6c017
DEV: Update `backburner.js` to include bugfix and dev improvements (#18549)
This version of backburner is patched to include
- Fix for scheduleOnce/cancel bug: https://github.com/BackburnerJS/backburner.js/pull/402
- Async stack debugging in Chrome: https://github.com/BackburnerJS/backburner.js/pull/404

The async debugging feature is enabled only in debug builds of Discourse to ensure production performance is unaffected.

Adding to `vendorFiles` causes the JS to be inserted directly after the `ember-source` bundle. That means that the `backburner` module defined by ember-source will be replaced with the patched version.
2022-10-12 10:06:03 +01:00
Martin Brennan 84f2529138
FEATURE: Add contentCSSClass for sidebar section-link (#18555)
In some cases, like in the chat plugin for muted channels,
we want to change the style of the sidebar content text.
This adds a new contentCSSClass function to the
BaseCustomSidebarSectionLink class and uses it in both
sections and section-link to add the CSS class if it is
provided.
2022-10-12 12:42:15 +10:00
Krzysztof Kotlarek e5b306b13e
FIX: warning about sidebar prefix style (#18553)
New double color feature introduced warning about CSS. Related PR https://github.com/discourse/discourse/pull/18525
2022-10-12 08:55:47 +08:00
Rafael dos Santos Silva 6888eb5c2d
Revert "Revert "FEATURE: Preload resources via link header (#18475)" (#18511)" (#18531)
* Revert "Revert "FEATURE: Preload resources via link header (#18475)" (#18511)"

This reverts commit 95a57f7e0c.

* put behind feature flag

* env -> global setting

* declare global setting

* forgot one spot
2022-10-11 20:11:44 -03:00
Jordan Vidrine 47fa4dbef3
FIX: User field styling on login (#18551) 2022-10-11 16:51:02 -05:00
Kris 6d8405bbd0
UX: updated styles for user nav with sidebar (#18550) 2022-10-11 17:15:58 -04:00
Osama Sayegh ac9fbb56a4
DEV: Improve UX for user menu tabs when they're empty (#18520)
This commit adds more helpful/education messages that show up in the replies and "other notifications" tabs when they're empty. Internal topic: t/76879.
2022-10-11 18:33:09 +03:00
David Taylor f3e956a7a3
FIX: Staff action log 'show details' links (#18542)
Followup to 03b7b7d1bc
2022-10-11 12:17:36 +01:00
Alan Guo Xiang Tan b75dc04a25
UX: Hide tags section from anonymous user when site has no tags (#18538)
If there are no top tags that an anonymous user can see and the site do
not have default sidebar tags configured for anonymous users, hide the
tag section entirely.
2022-10-11 13:33:50 +08:00
Martin Brennan 472abe532e
DEV: Add experimental setting for hashtag-autocomplete changes (#18537)
This initial PR just adds a enable_experimental_hashtag_autocomplete
setting, and related JS & HBR files, replacing direct setup of
the autocomplete within d-editor and instead using the new
lib/hashtag-autocomplete. This is the beginning of preparations
to allow other data sources to be added to this autocomplete,
as well as a redesign of the menu and rendered tags in the composer
preview and posts.
2022-10-11 13:15:16 +10:00
Martin Brennan b6854c2f88
FIX: Deprecated settings should not override from UI (#18536)
Unless we have specified `override = true` in the DeprecatedSettings
class for an old -> new settings map, we should not allow people
to change the old setting in the UI and have it affect the new
setting.
2022-10-11 11:14:13 +10:00
Alan Guo Xiang Tan a7bdd0a58e
PERF: Exclude anon sidebar tags in site serializer for logged in user (#18527)
This commits excludes the `anonymous_default_sidebar_tags` property in `SiteSerializer` when user
is not anonymous and when tagging has been disabled.
2022-10-11 08:45:22 +08:00
Krzysztof Kotlarek b02ece0bbb
FEATURE: double color for subcategories prefix (#18525)
Subcategories should display color from parent category and subcategory to clearly indicate that it is a subcategory.
2022-10-11 10:27:06 +11:00
Bianca Nenciu dc89b72d46
FIX: Show error if field is same as password (#18529)
* FIX: Show user fields validation errors

* FIX: Show error if user field is same as password
2022-10-10 20:00:52 +03:00
Bianca Nenciu 08ab09c928
FIX: Remove public topic invite functionality (#18488)
This can no longer be used from the user interface and could be used to
generate useless topic invites notifications. This commit adds site 
setting max_topic_invitations_per_minute to prevent invite spam.
2022-10-10 19:21:51 +03:00
Andrei Prigorshnev b06cc8a836
DEV: Decouple the user status modal from current user's status (#18514) 2022-10-10 17:45:21 +04:00
Arpit Jalan 140200ae83
FIX: do not show welcome CTA banner if the welcome topic is deleted (#18528) 2022-10-10 16:53:19 +05:30
Alan Guo Xiang Tan b2a14eeb16
FIX: Ensure group inboxes in messages section is sorted by group name (#18508) 2022-10-10 14:47:55 +08:00
chapoi 7009f9c95e
UX: correct colour to nav instead of danger (#18515) 2022-10-08 01:06:20 +02:00
Andrei Prigorshnev ec65f3c1ad
DEV: Pass a status object to the user-status-picker instead of passing emoji + description (#18513) 2022-10-08 02:21:53 +04:00
David Taylor 26b9500983
DEV: Fix `bread-crumbs-right` `currentCategory` argument (#18491) 2022-10-07 19:34:28 +01:00
Rafael dos Santos Silva 95a57f7e0c
Revert "FEATURE: Preload resources via link header (#18475)" (#18511)
This reverts commit 2d1dbc6f96.

We need to increase nginx proxy buffer to land this.
2022-10-07 15:08:40 -03:00
Rafael dos Santos Silva 2d1dbc6f96
FEATURE: Preload resources via link header (#18475)
Experiment moving from preload tags in the document head to preload information the the response headers.

While this is a minor improvement in most browsers (headers are parsed before the response body), this allows smart proxies like Cloudflare to "learn" from those headers and build HTTP 103 Early Hints for subsequent requests to the same URI, which will allow the user agent to download and parse our JS/CSS while we are waiting for the server to generate and stream the HTML response.

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2022-10-07 13:19:50 -03:00
Penar Musaraj a1d67122b1
DEV: Refactor the last few bootbox dialogs (#18416) 2022-10-07 11:38:27 -04:00
Penar Musaraj 6426932834
UX: Default to dark category logo on dark schemes (#18510)
Fixes an edge case for when a category has a dark logo and the default
color scheme is dark.
2022-10-07 11:37:07 -04:00
Jarek Radosz d2d4749127
DEV: Asyncify `Composer.createPost()` (#18026)
I convert these Composer (and Topic) functions one by one because stuff do be breaking 😄

Moved the special pretender handler code from the global one to the tests that actually require it.
2022-10-07 17:25:15 +02:00
Jan Cernik 08476f17ff
FEATURE: Add dark mode option for category logos (#18460)
Adds a new upload field for a second dark mode category logo. 
This alternative will be used when the browser is in dark mode (similar to the global site setting for a dark logo).
2022-10-07 11:00:44 -04:00
Alan Guo Xiang Tan 14532ad425
DEV: Try out double nav for new experimental user page nav (#18495)
No tests and this redesign is still highly highly experimental
2022-10-07 12:20:39 +08:00
Martin Brennan cb26d52d33
DEV: Remvoe IMAGES_EXTENSIONS_REGEX const in lib/uploads (#18497)
This IMAGES_EXTENSIONS_REGEX const just creates redundancy
when we already have the `isImage` function -- the two can
easily get out of sync. Replace all usages of the former
with the latter.
2022-10-07 09:24:08 +10:00
dependabot[bot] 0059be6856
Build(deps): Bump ember-cached-decorator-polyfill (#18507)
Bumps [ember-cached-decorator-polyfill](https://github.com/ember-polyfills/ember-cached-decorator-polyfill) from 0.1.4 to 1.0.1.
- [Release notes](https://github.com/ember-polyfills/ember-cached-decorator-polyfill/releases)
- [Changelog](https://github.com/ember-polyfills/ember-cached-decorator-polyfill/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ember-polyfills/ember-cached-decorator-polyfill/compare/v0.1.4...v1.0.1)

---
updated-dependencies:
- dependency-name: ember-cached-decorator-polyfill
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-07 00:58:21 +02:00
chapoi d507151508
UX: add more spacing to tab btns (#18506) 2022-10-06 23:53:06 +02:00
chapoi bd61f877bb
FEATURE: new outlet topic-list-main-link-bottom added to mobile (#18505) 2022-10-06 23:51:32 +02:00
Keegan George 70d0892ac9
FIX: Arrive at topic must be hidden when `must_approve_users` (#18504) 2022-10-06 12:04:26 -07:00
Bianca Nenciu 73e9875a1d
FEATURE: Handle oneboxes for complex GitHub URLs (#18474)
GitHub PR URLs can link to a commit of the PR, a comment or a review
discussion.
2022-10-06 20:26:04 +03:00