We have had multiple issues while using the chrome channel:
- super slow start of the spec, I can confirm I don't have it on
chromium
- more risk of different failures between local dev machines and CI
There was a test not working on chromium, as it doesn't have mp4 codecs
out of the box. I changed the spec to use webm instead and it's now
working correctly.
This commit also fixes a bug with the video/trace paths which were
incorrect, and also makes another test less flakey with uploads event
though Im not very clear on what is going on here, we need to dig this.
We now need to figure out a way to have this on the test image, but this
is for now a better solution.
Chat is currently broken in local development if anonymous mode is enabled in site settings. This is happening after #32416. One of the strict_loading directives in ChannelFetcher is trickling down to an anonymous user check.
We don't need to enforce strict_loading on this 1-to-1 association that's only used in a few code paths, so mark it as strict_loading: false on the User model.
This PR replaces the set of methods related to validation and
normalization of input values in the select-kit utils mixin with simple
exported functions from a input-utils lib file.
We maintain the `_normalize` method on the select-kit component because
there are external repos dependent on that part of the interface.
We'll replace the remainder of the mixin with another utils lib file in
a separate PR.
Instead of simple match keywords, search login was a bit enhanced by calculating score.
20 points if item label starts with searched phrase. This is to prioritize automation when auto is typed;
10 points for each exact word matches keywords. This is to prioritize discourse-ai when ai is typed;
5 points if matches fallback to original phrase match.
In addition, stop showing loading sign when modal is opened.
This commit adds a basic fallback to prevent errors for extensions accessing
`helper.widget` when using `api.decorateCookedElement`.
The purpose of the fallback is provide access to `.widget.attrs`and
`scheduleRerender()` which are common scenarios.
Since the call to the callback happens only when rendering the auto mode
of the Glimmer Post Stream can't detect the existence of these
customizations. The PR also adds a deprecation notice in the console.
…Hub (#31929)"
This reverts commit 5f8a183abf24d0f54f7334d19152a09e9ae241c6. The issue
has been resolved in the latest version of the DiscourseHub app. (Will
merge this once that version goes through Apple review.)
We have gradually moved the pages out of the Account section in the admin sidebar. This moves the last one, Backups, to the Advanced section, and entirely removes Account.
This commit is replacing the system specs driver (selenium) by
Playwright: https://playwright.dev/
We are still using Capybara to write the specs but they will now be run
by Playwright. To achieve this we are using the non official ruby
driver: https://github.com/YusukeIwaki/capybara-playwright-driver
### Notable changes
- `CHROME_DEV_TOOLS` has been removed, it's not working well with
playwright use `pause_test` and inspect browser for now.
- `fill_in` is not generating key events in playwright, use `send_keys`
if you need this.
### New spec options
#### trace
Allows to capture a trace in a zip file which you can load at
https://trace.playwright.dev or locally through `npx playwright
show-trace /path/to/trace.zip`
_Example usage:_
```ruby
it "shows bar", trace: true do
visit("/")
find(".foo").click
expect(page).to have_css(".bar")
end
```
#### video
Allows to capture a video of your spec.
_Example usage:_
```ruby
it "shows bar", video: true do
visit("/")
find(".foo").click
expect(page).to have_css(".bar")
end
```
### New env variable
#### PLAYWRIGHT_SLOW_MO_MS
Allow to force playwright to wait DURATION (in ms) at each action.
_Example usage:_
```
PLAYWRIGHT_SLOW_MO_MS=1000 rspec foo_spec.rb
```
#### PLAYWRIGHT_HEADLESS
Allow to be in headless mode or not. Default will be headless.
_Example usage:_
```
PLAYWRIGHT_HEADLESS=0 rspec foo_spec.rb # will show the browser
```
### New helpers
#### with_logs
Allows to access the browser logs and check if something specific has
been logged.
_Example usage:_
```ruby
with_logs do |logger|
# do something
expect(logger.logs.map { |log| log[:message] }).to include("foo")
end
```
#### add_cookie
Allows to add a cookie on the browser session.
_Example usage:_
```ruby
add_cookie(name: "destination_url", value: "/new")
```
#### get_style
Get the property style value of an element.
_Example usage:_
```ruby
expect(get_style(find(".foo"), "height")).to eq("200px")
```
#### get_rgb_color
Get the rgb color of an element.
_Example usage:_
```ruby
expect(get_rgb_color(find("html"), "backgroundColor")).to eq("rgb(170, 51, 159)")
```
This reverts commit 427d4d2b53fcddf771e450ebaa3dbf5140c9fb7a.
This prevents us from knowing which commit broke the build. Revert for
now while we figure out a better solution.
This PR replaces the use of the tags mixin for select-kit components
with a tag-utils service instead.
Main changes:
1. Remove methods needed to set selectKitOptions key `allowAny` from the
service, this was largely unnecessary since 3 out of 4 components using
the mixin already defined their own selectKitOptions `allowAny` (which
would override the mixin version), and the last component
`mini-tag-chooser` overrode the _value_ with its own `allowAnyTag`
property.
2. Remove all state from service and decouple from whole components by
explicitly requiring that any dependent property/callback be passed in
as arguments to the methods (so anything relying on `this` or
`context`). `site` and `siteSettings` are explicitly injected as
services into the tag-utils service as well for access to their
properties.
3. `_transformJson` needs to be passed into the service as a callback
that acts on the component, and I chose the `@bind` decorator for this.
`@action` doesn't work too well here as it results in subtle timing
errors where later on in the cycle, this results in setting properties
on destroyed components.
In the /admin/badges view, badges are showing as enabled even when they are verifiably disabled in the database.
This is happening because the defaults (needed to render the "new badge" form) are overwriting the actual value.
Since the enabled default is only used for "new badge" form, move it to the route where the other "new badge" defaults are being set.
Previous to this change when we used to specify format it could get an
image
in the incorrect format.
Also... allows image magick to decode svg
---
There remains a bug where the crop / resize information is not stored in
optimized images
this means that sometimes when asking for a cropped image you may get a
resized one.
The rich editor is loaded asynchronously, so when `allowPreview` starts
as `true`, if we're opening the composer for the 1st time, ProseMirror
dependencies will be loaded async and while the rich editor is fully
loaded, the composer animates from having a preview to not having one,
shrinking in width.
This changes the `allowPreview` to be default `false`, so the animation
never happens – when the default composer editor is set to the Markdown
editor, it'll instantly and synchronously set the tracked property,
before any animation kicks in.
Follow-up to https://github.com/discourse/discourse/pull/31742
This commit adds a color palettes list to the new color palette edit page
that was introduced in the linked PR to allow navigating between color
palettes. It reuses the same UI that we already have in the legacy color
palette UI (`/admin/customize/colors`), but we may redesign the page in
the future.
There are instances of posts being deleted by system_user where the context is left blank in the staff action logs, leading to confusion about why exactly they have been deleted.
This change deprecates using the PostDestroyer as system_user without providing a context, and adds a context to all call sites currently missing it in core. Plugins to be done after this is merged.