Commit Graph

52436 Commits

Author SHA1 Message Date
Sam
7b12be866d
FIX: never skip push notifications (#25099)
* FIX: never skip push notifications

According to Apple, silent push notifications are automatically punished per:

https://developer.apple.com/videos/play/wwdc2022/10098/?time=814

> As mentioned when I showed you the code on how to request a push
> subscription, you must promise that pushes will be user visible.
> Handling a push event is not an invitation for your JavaScript to
> get silent background runtime. Doing so would violate both a user’s
> trust and a user’s battery life. When handling a push event, you are
> in fact required to post a notification to Notification Center.
> Other browsers all have countermeasures against violating the promise
> to make pushes user visible, and so does Safari.
> In the beta build of macOS Ventura, after three push events where you
> fail to post a notification in a timely manner, your site’s push
> subscription will be revoked. You will need to go through the permission
> workflow again.

The isIdle check was causing certain push notifications to be silent

Additionally, the auto dismissal logic was causing delays which may cause
the device to think the push was a silent one.

By removing this we hope to ensure push notification delivery is more robust
and consistent on iOS.
2024-01-03 12:23:04 +11:00
Kris
e8509ddf50
FIX: github onebox styles for commits (#25098) 2024-01-02 17:29:56 -05:00
Kris
f999cde159
UX: update post background highlight (#25094) 2024-01-02 16:53:40 -05:00
Kris
c2dc2cd727
UX: add gap between category and tags in suggested topics (#25097) 2024-01-02 16:40:35 -05:00
dependabot[bot]
cee446f62a
Build(deps-dev): Bump shoulda-matchers from b8d04ee to 2a2b062 (#25096)
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from `b8d04ee` to `2a2b062`.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Commits](b8d04ee4c5...2a2b06276f)

---
updated-dependencies:
- dependency-name: shoulda-matchers
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 22:40:23 +01:00
Isaac Janzen
4886c1fddc
DEV: Update when / how we display of full name on search-item-user (#25090)
- Full name should only be displayed within `initial options`
- Keep results on a single line unless full name is included

# Initial Options
<img width="416" alt="Screenshot 2024-01-02 at 9 58 07 AM" src="https://github.com/discourse/discourse/assets/50783505/a9f6880a-86e0-4683-978a-c0391a90c78e">

# Other
<img width="432" alt="Screenshot 2024-01-02 at 9 58 43 AM" src="https://github.com/discourse/discourse/assets/50783505/83b508b0-c501-4fb7-89f7-8e66dc88979f">
<img width="424" alt="Screenshot 2024-01-02 at 9 58 18 AM" src="https://github.com/discourse/discourse/assets/50783505/b98223d7-f92c-4803-87bf-0470e6ce05ed">
2024-01-02 10:26:40 -07:00
Discourse Translator Bot
8e1fc93748
Update translations (#25088) 2024-01-02 15:25:58 +01:00
Arpit Jalan
878d973d90
FIX: fixes for microdata schema rendering (#25082)
d9ca6c3bb9 (r135940042)
2024-01-02 19:23:57 +05:30
David Taylor
7d0e0c3110
DEV: Collect css assets from webpack build (#25087)
fb95ab8e00 started depending on webpack-bundled CSS, but css files weren't being collected by Sprockets or uploaded to S3.
2024-01-02 12:45:34 +00:00
dependabot[bot]
37127ec141
Build(deps): Bump the babel group in /app/assets/javascripts with 2 updates (#25075)
* Build(deps): Bump the babel group

Bumps the babel group in /app/assets/javascripts with 2 updates: [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) and [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/core` from 7.23.6 to 7.23.7
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.7/packages/babel-core)

Updates `@babel/standalone` from 7.23.6 to 7.23.7
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.7/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: babel
- dependency-name: "@babel/standalone"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: babel
...

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

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2024-01-02 11:51:42 +01:00
David Taylor
34ae2080c6
DEV: Merge mobile/desktop navigation-bar templates (#25017)
Having separate mobile/desktop templates is something we're moving away from. This commit moves the mobile-specific logic into a conditional in the main colocated template.
2024-01-02 10:48:31 +00:00
David Taylor
fb95ab8e00
DEV: Use webpack to load table-builder dependencies (#25018)
This avoids the need to vendor the JS/CSS in our git repository
2024-01-02 10:47:47 +00:00
David Taylor
e47ad13122
DEV: Colocate mobile-nav template (#25016)
Previously it was relying on the `templates/mobile` logic to make this a simple div wrapper on mobile, and a more complex implementation on mobile. This commit colocates the template so it's active on mobile and desktop, but adds an `{{#if` block to explicitly change the behavior.
2024-01-02 10:47:21 +00:00
David Taylor
236f3cc6eb
UX: Add 'edit' link to theme colour palette selector (#25073) 2024-01-02 10:45:52 +00:00
David Taylor
641c689ac1
DEV: Patch deprecated-run-loop-and-computed-dot-access in production (#25074)
In Ember, these deprecations are wrapped in an `if(DEBUG)` check, so they are optimized out of the production build. We prefer to keep deprecations in production so that we can collect telemetry and warn theme authors who do not use local development environments.

This commit restores the deprecations as part of our ember-production-deprecations addon.
2024-01-02 10:44:26 +00:00
Natalie Tay
b4f36507e0
FIX: Allow the flags to be cleaned up (#25085)
Currently, the reviewable queue includes ReviewableFlaggedPost with posts that have already been hidden. This allows for such hidden posts to be cleared up by the auto-tool.
2024-01-02 18:32:50 +08:00
Martin Brennan
b92993fcee
FIX: Post copy link not working (#25086)
Followup to c6cb319671,
the actionCallback function was double-wrapped with () => {}
which meant that copyClipboard did not return a promise.
2024-01-02 19:23:41 +10:00
Alan Guo Xiang Tan
6b8e051e73
DEV: Update Rails to 7.0.8 (#25084)
See https://github.com/rails/rails/releases/tag/v7.0.8
2024-01-02 10:19:08 +08:00
dependabot[bot]
a2e4cc0903
Build(deps-dev): Bump sass from 1.69.5 to 1.69.6 in /app/assets/javascripts (#25076)
* Build(deps-dev): Bump sass in /app/assets/javascripts

Bumps [sass](https://github.com/sass/dart-sass) from 1.69.5 to 1.69.6.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.69.5...1.69.6)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2024-01-02 08:43:40 +08:00
dependabot[bot]
187d5c7b0d
Build(deps-dev): Bump shoulda-matchers from 4886266 to b8d04ee (#25077)
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from `4886266` to `b8d04ee`.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Commits](48862663f8...b8d04ee4c5)

---
updated-dependencies:
- dependency-name: shoulda-matchers
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 08:43:24 +08:00
dependabot[bot]
a9ee94c818
Build(deps): Bump sassc-embedded from 1.68.6 to 1.69.1 (#25079)
Bumps [sassc-embedded](https://github.com/sass-contrib/sassc-embedded-shim-ruby) from 1.68.6 to 1.69.1.
- [Commits](https://github.com/sass-contrib/sassc-embedded-shim-ruby/compare/v1.68.6...v1.69.1)

---
updated-dependencies:
- dependency-name: sassc-embedded
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 08:40:54 +08:00
dependabot[bot]
a4fc7f983c
Build(deps): Bump rack-protection from 3.1.0 to 3.2.0 (#25080)
Bumps [rack-protection](https://github.com/sinatra/sinatra) from 3.1.0 to 3.2.0.
- [Changelog](https://github.com/sinatra/sinatra/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sinatra/sinatra/compare/v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: rack-protection
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 08:40:40 +08:00
dependabot[bot]
c5fb3d45ba
Build(deps): Bump cbor from 0.5.9.6 to 0.5.9.8 (#25081)
Bumps [cbor](http://cbor.io/) from 0.5.9.6 to 0.5.9.8.

---
updated-dependencies:
- dependency-name: cbor
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 08:40:27 +08:00
Sam
baa7c4cec7
FIX: allow styling of feedback on mobile (#25072)
(to test try using discourse-ai which displays feedback on mobile)


---------

Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
2023-12-30 08:57:16 +11:00
David Battersby
406f4c9e80
DEV: fix flaky back to forum spec (#25071)
Fixes a flaky test by ensuring Capybara finishes loading the topic page before attempting to open chat. The back to forum url relies on a tracked property (previous url), which is set when visiting the topic page.
2023-12-29 16:55:12 +08:00
Alan Guo Xiang Tan
2b3a572987
DEV: Attempt to fix flaky test by using click_button instead of click (#25070)
Why this change?

Some of the tests in `spec/system/table_builder_spec.rb` are flaky when
we are asserting that clicking the cancel button will close the modal.
This change attempts to fix it by using the `click_button` method
instead of `find` then `click` which is more reliable.
2023-12-29 14:39:37 +08:00
Alan Guo Xiang Tan
0756486b65
FIX: Adding form template to category dropdown can some times be empty (#25066)
Why this change?

A system test which was testing our ability to add a form template to a
category was flaky. This turned out to be a client side bug where the
`FormTemplateChooser` dropdown may not display any dropdown options if
the ajax request to fetch the categories form template has not been
completed when the dropdown is opened.

What does this change do?

Make use of select-kit's `triggerSearch` function to fetch the records
which will properly rerender the dropdown options.
2023-12-29 14:15:56 +08:00
Alan Guo Xiang Tan
ea910e291b
DEV: Remove assertion causing test to be flaky (#25069)
Why this change?

The assertion does not make use of Capybara's waiting strategy and is
not really testing anything meaningful by asserting for the src of the
img element.
2023-12-29 13:23:16 +08:00
Sam
c6cb319671
DEV: API allow post actions to optionally provide visual feedback
post action feedback is the mechanism in which we provide visual feedback
to the user when a post action is clicked, in cases where the action is a
background (hidden to user) for example: copying text to the clipboard

Core uses this to share post links, but other plugins (for example: AI) use
this to share post transcripts via the clipboard.

This adds a proper plugin API to consume this functionality

`addPostMenuButton` can provide a builder that specified a function as the action. 

This function will be called with an object that has both the current post and a method for showing feedback.
2023-12-29 15:59:43 +11:00
dependabot[bot]
f5380bb890
Build(deps): Bump nokogiri from 1.15.5 to 1.16.0 (#25064)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.15.5 to 1.16.0.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.15.5...v1.16.0)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-29 12:45:38 +08:00
Joffrey JAFFEUX
40ce619edd
DEV: uses in: {} with lambda to work with eager_load (#25039)
When validating with a dynamic set of values, especially one that might change during runtime, we should use a lambda or a proc to ensure that the validation uses the most up-to-date set of values. This is particularly important when using config.eager_load = true, which can cause some elements to be loaded only once at startup, thus not reflecting changes made at runtime.

This was the root cause of the issues here, as we were adding more ReviewableScore types after initial load through: `register_reviewable_type Chat::ReviewableMessage`
2023-12-29 12:45:07 +08:00
Alan Guo Xiang Tan
6e8c2bb4ab
DEV: Improve error message when test fails (#25067)
Why this change?

The two tests being updated in question has been flaky on CI. However,
when using `be_forbidden`, the error message does not indicate what the
actual response code was making it hard for us to debug.

What does this change do?

Assert for the exact response status code we are expecting.
2023-12-29 12:44:41 +08:00
Gerhard Schlager
ce57969016
DEV: Add "migrations-tooling" label to PRs for import scripts (#25062)
Also, PRs for import scripts should automatically be assigned to the migrations-tooling group.
2023-12-28 21:26:05 +01:00
Gerhard Schlager
d7601388e5
DEV: Apply code format to import script (#25063) 2023-12-28 21:25:29 +01:00
Sebastian Wagner
050a285f40
FEATURE: Import Script for Fusionforge (#22281)
This is an import script for the forum/development platform https://www.fusionforge.org/projects/fusionforge
imports users, forums and posts including attachments
2023-12-28 20:36:30 +01:00
dependabot[bot]
a3a74ee4a5
Build(deps-dev): Bump sqlite3 from 1.6.9 to 1.7.0 (#25051)
Bumps [sqlite3](https://github.com/sparklemotion/sqlite3-ruby) from 1.6.9 to 1.7.0.
- [Release notes](https://github.com/sparklemotion/sqlite3-ruby/releases)
- [Changelog](https://github.com/sparklemotion/sqlite3-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/sqlite3-ruby/compare/v1.6.9...v1.7.0)

---
updated-dependencies:
- dependency-name: sqlite3
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-28 20:30:53 +01:00
Matías García Isaía
3e5d2cb2e3
Fix typos and internal links in INSTALL-cloud (#25058)
Looks like we added a section, thus changing all the internal links in the Table of Content.
2023-12-28 20:27:43 +01:00
Rafael dos Santos Silva
a6cf2d20e6
FEATURE: Topic crawler view bottom plugin outlet (#25060) 2023-12-28 15:16:30 -03:00
David Taylor
48ad326ba4
FIX: Handle deprecations correctly in server-side pretty-text (#25059)
`window.deprecationWorkflow` does not exist in the server-side pretty-text environment. This commit fixes the check and adds a general spec for deprecations triggered inside pretty-text
2023-12-28 16:35:06 +00:00
Isaac Janzen
8e58c6dd93
DEV: Add extension points to Admin User Fields (#25021)
- Add plugin outlet to `AdminUserFieldItem`
- Add ability to include custom fields when saving `AdminUserFieldItem` 
- Update plugin API with `includeUserFieldPropertiesOnSave` per ☝️ 
- Add `DiscoursePluginRegistry` to `UserFieldsController` to add custom columns
2023-12-28 08:24:24 -07:00
marstall
ddd750cda7
FEATURE: change /invites.json api endpoint to optionally accept array of emails (#24853)
https://meta.discourse.org/t/feature-request-sending-bulk-invitations-via-api/272423/18
2023-12-28 10:16:04 -05:00
Bianca Nenciu
14269232ba
DEV: No longer preload categories (#24950)
Categories will no longer be preloaded when `lazy_load_categories` is
enabled through PreloadStore.

Instead, the list of site categories will continue to be populated
by `Site.updateCategory` as more and more categories are being loaded
from different sources (topic lists, category selectors, etc).
2023-12-28 14:36:33 +02:00
Bianca Nenciu
c4396c6acf
DEV: Prefer Ember's RSVP over native Promise (#25049)
This causes an incompatibility in some plugins that are patching the
discovery-categories route, such as discourse-global-filter.
2023-12-28 14:15:35 +02:00
David Battersby
1061bf97e2
UI: chat header style improvements (#25057)
Small visual improvements for chat header on mobile:

- makes the Back to Forum target size slightly narrower
- makes the text color consistent between header and back button (and d-icon)
- makes the chat heading bold
2023-12-28 17:44:53 +08:00
Discourse Translator Bot
cd818ab63f
Update translations (#25041) 2023-12-28 10:12:53 +01:00
David Battersby
3d4b62651e
FIX: chat drawer routing fix for threads (#25056)
This change fixes a minor regression in the chat back button navigation.
2023-12-28 15:02:33 +08:00
Sam
d5e1b3e683
DEV: add test that ensure include_raw param continues to work (#25055)
Previously we hand no tests for `include_raw` which some consumers may
depend on.

Specifically, Discourse AI uses it to get raw markdown for a set of posts
on a topic.

Also cleans up tests so they lint with default ruby
2023-12-28 14:26:27 +11:00
Sam
b4c1b10969
FIX: copy link not working in non secure context (#25053)
In non secure contexts (HTTP vs HTTPS) which many run in development the
`clipboardCopy` method falls back to and an exec hack.

However, callers expect a promise from this method and the fallback just
returns a boolean.
2023-12-28 10:42:23 +11:00
David Battersby
a7fe2e1a48
FIX: pass args in chat header logo plugin outlet (#25050)
This change passes down all params to the home logo widget (rather than explicitly setting minimized). This will allow for flexible logo sizing in the Discourse full width theme component.
2023-12-27 19:43:20 +08:00
Alan Guo Xiang Tan
655c106101
DEV: Capture and log AR debug logs on GitHub actions for flaky tests (#25048)
Why this change?

We have been running into flaky tests which seems to be related to
AR transaction problems. However, we are not able to reproduce this
locally and do not have sufficient information on our builds now to
debug the problem.

What does this change do?

Noe the following changes only applies when `ENV["GITHUB_ACTIONS"]` is
present.

This change introduces an RSpec around hook when `capture_log: true` has
been set for a test. The responsibility of the hook is to capture the
ActiveRecord debug logs and print them out.
2023-12-27 14:40:00 +08:00