Commit Graph

1632 Commits

Author SHA1 Message Date
Ilya Kreymer
147096c972
Additional translations (Weblate->Main )(#2255)
Merge more Spanish translations updates to main for 1.13 release

Co-authored-by: Weblate (bot) <hosted@weblate.org>
Co-authored-by: Clara Itzel <missclaraitzel@gmail.com>
Co-authored-by: Lorena Ramírez-López <lorena@webrecorder.org>
Co-authored-by: Webrecorder Dev <dev@webrecorder.org>
Co-authored-by: weblate <weblate@users.noreply.github.com>
2024-12-17 15:51:43 -08:00
sua yoo
9597cb1062
chore: Prevent blocking connected callback (#2244)
Moves language initialization to `willUpdate` to prevent blocking
connected callback and attaching listeners
2024-12-17 09:29:51 -08:00
sua yoo
02eeaca245
test: Update Playwright E2E test settings (#2247)
- Moves E2E test user to dedicated env variables
- Fixes playwright test redirect issue

---------

Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
2024-12-16 17:36:21 -08:00
Ilya Kreymer
daae82191f
add missing toast id: (#2245)
- follow up to #2236, add a toast for account settings localization
formatting
2024-12-16 17:05:49 -05:00
Ilya Kreymer
02c4381694
fix rendering org list if org.created is null: (#2243)
- org.created may be null (for backwards compatibility before it was
set)
- fix frontend type to match backend
- update format.date() to accept null, return empty string
2024-12-13 21:11:26 -08:00
Ilya Kreymer
cf60c43df2
version: bump to 1.13.0! (#2242) 2024-12-13 20:32:38 -08:00
Ilya Kreymer
c27758a0f6
quickfix: update test_api.py to match all locales enabled by default (#2241) 2024-12-13 20:30:06 -08:00
Ilya Kreymer
74ae3b0f8d
Add new locales (#2240)
- By default, all locales are enabled to make it easy for local deployments to test new locales
- Adds DE, FR, PT locales to make way for translation in Weblate
2024-12-13 19:59:09 -08:00
Emma Segal-Grossman
b650762a45
Allow configuring available languages from helm chart (#2230)
Closes #2223 

- [x] Adds `localesAvailable` to `/api/settings` endpoint, and uses that
list if available, rather than the full list of translated locales, to
determine which options to display to users
- [x] ~~Uses the user's browser locales, filtered to the current
language setting, for formatting numbers, dates, and durations~~
- [x] Adds & persists checkbox for "use same language for formatting
dates and numbers" in user settings
- [x] Replaces uses of `sl-format-bytes` with `localize.bytes(...)`, and
`sl-format-date` with replacement `btrix-format-date` that properly
handles fallback locales
- [x] Caches all number/duration/datetime formatters by a combined key
consisting of app language, browser language, browser setting, and
formatter options so that all formatters can be reused if needed
(previously any formatter with non-default options would be recreated
every render)
- [x] Splits out ordinal formatting from number formatter, as it didn't
make much sense in some non-English locales
- [x] Adds a little demo of date/time/duration/number formatting so you
can see what effect your language settings have
  


https://github.com/user-attachments/assets/724858cb-b140-4d72-a38d-83f602c71bc7

---------

Signed-off-by: emma <hi@emma.cafe>
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
2024-12-13 22:31:26 -05:00
Emma Segal-Grossman
46aab91ef5
Adds optional IDs to toasts to replace rather than add to toast stack (#2236)
This has been bugging me for a while — any type of repetitive action
that shows a toast will quickly cause a big stack of toasts to build up.
This fixes that by allowing different categories of toasts to exist,
where each category can only have one active toast. _Different_
categories of toast can coexist just fine, but toasts with the same `id`
will replace any existing toast with that same `id`.

It's been a pet peeve for a while, and it should make any sort of "power
user" use of Browsertrix a lot nicer :)

I've gone over all the existing toasts and applied what feel like decent
differentiations, but I'm not set on any of them — open to suggestions!


https://github.com/user-attachments/assets/dbe39141-9e56-427d-b702-124c45ef2b9a

---------

Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
2024-12-13 15:27:01 -05:00
Ilya Kreymer
3e6788b2c1
analytics path in dev server (#2231)
quick follow-up to #2226:
- rename script _plausible.js -> analytics.js to be more generic
- devserver: serve empty /analytics.js from webpack dev server

---------

Co-authored-by: emma <hi@emma.cafe>
2024-12-12 15:06:03 -05:00
Ilya Kreymer
db39333ef4
Send subscription cancelation email (#2234)
Adds sending a cancellation email when a subscription is cancelled.
- The email may also include an option survey optional survey URL, if
configured in helm chart `survey_url` setting.
- Cancellation e-mail configured in `sub_cancel` e-mail template
- E-mails are sent to all org admins.
- Also adds `trialing_canceled` subscription state to differentiate from
a default `trialing` which will automatically rollover into `active`.
- The email is sent when: a new cancellation date is added for an
`active` subscription, or a `trialing` subscription is changed to to
`trialing_canceled`. (A subscription can be canceled/uncanceled several
times before actual date, and e-mail is sent every time it is canceled.)
- The 'You have X days left of your trial' is also always displayed when
state is in trialing_canceled.

Fixes #2229
---------

Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
2024-12-12 11:52:38 -08:00
Emma Segal-Grossman
a65ca49ddd
Plausible analytics (#2226)
Closes #2222 

Adds a runtime script that gets set to either inject the plausible
script tags, or do nothing, that runs at initialization of the frontend
container.
2024-12-10 16:30:22 -08:00
sua yoo
541298eb48
fix: Prevent submitting invalid regex with keyboard enter (#2228)
Fixes https://github.com/webrecorder/browsertrix/issues/2227
2024-12-10 00:00:09 -08:00
Tessa Walsh
b7604ee61d
Add superuser endpoint to get user emails with org info (#2211)
Fixes #2203

---------

Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
2024-12-09 16:38:01 -08:00
Ilya Kreymer
b041baf5df
Changes to support weblate workflow (#2210)
This PR syncs the weblate branch back to main, and adds:
- New Spanish translations contributed in weblate!
- New GH action which reformats weblate commits with `localize:extract`,
ensuring strings are not changed, and also runs `localize:build` to
extract templates (as tested in PR: #2207)
- Reformats existing XLIFF files to match `localize:extract`, including
adding self-closing tags.
- Update on generated templates
- Prettier: disable alpha sorting XML attributes to hopefully minimize
conflcits
- Strings: change some strings that use `&` to be wrapped in html`` to
ensure proper unencoding, or just switch to 'and' where that's not
possible.

---------

Co-authored-by: Weblate (bot) <hosted@weblate.org>
Co-authored-by: Webrecorder Dev <dev@webrecorder.org>
Co-authored-by: Kamborio <Kamborio15@users.noreply.hosted.weblate.org>
Co-authored-by: Clara Itzel <missclaraitzel@gmail.com>
Co-authored-by: weblate <weblate@users.noreply.github.com>
Co-authored-by: emma <hi@emma.cafe>
Co-authored-by: sua yoo <sua@webrecorder.org>
2024-12-09 15:16:47 -08:00
Ilya Kreymer
b741de0232
tweak the 'stop crawl' confirmation message to be more accurate (#2215)
More accurate description of what happens when the crawl is stopped
(reported by @dcgomes, revised by @emma-sg)
2024-12-07 13:16:09 -08:00
Emma Segal-Grossman
69f21b2a79
Add linguist-generated attribute to generated files (#2221)
Just some best practices [as outlined
here](https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github).
Should help make code reviews a little nicer.
2024-12-07 01:27:50 -05:00
Emma Segal-Grossman
a35c311571
Redirect previous crawl paths to new paths under their workflow (#2214)
Closes #2213 

This ended up being a bit of a variety PR, but primarily this fixes
issues around archived item pages for crawls at URL locations we no
longer support — specifically, crawls, which now live at
`/orgs/{oid}/workflows/{workflow_id}/crawl/{crawl_id}`, rather than
`/orgs/{oid}/items/crawl/{crawl_id}`, including the QA pages at
sub-paths of these. Attempting to view a crawl at the old (unsupported)
URL will now redirect you to the correct URL!

Other changes include:
- Updated links in various parts of the app — nothing should link to the
old URL pattern anymore for crawls!
- Improved `APIRouter` and `ViewState` typing
- A couple extra `APIRouter` tests
- An addition to the route definition for crawls at
`/orgs/{oid}/items/crawl/{crawl_id}` that allows for redirections from
QA review page URLs, rather than 404 errors — this was the actual
reported problem!
- Caching in CI for playwright tests
- `needsLogin` conversion from the deprecated `LiteElement` to
`BtrixElement`, along with all the components that use it


---------

Co-authored-by: emma-sg <emma-sg@users.noreply.github.com>
2024-12-06 16:06:59 -08:00
sua yoo
9736297c49
fix: More accurate rounded days in subscription end message (#2193)
Resolves https://github.com/webrecorder/browsertrix/issues/2192

## Changes

- Displays more accurate subscription/trial end message when
subscription ends between 1-2 days
- Shows timezone for end date

---------
Co-authored-by: SuaYoo <SuaYoo@users.noreply.github.com>
2024-12-05 14:22:27 -08:00
Henry Wilkinson
17459dc8cd
Minor help text & QA affordance improvements (#2189)
Some minor UX improvements, mostly suggested by @dcgomes

### Changes
- Updates in-app help text for crawl workflow limits.
- Adds a prompt to view error logs on the QA screen if failed pages > 1
- The error logs will give some insight as to why the pages failed every
time! Good thing to make the user do next!

### Screenshots

<img width="324" alt="Screenshot 2024-11-29 at 6 44 28 PM"
src="https://github.com/user-attachments/assets/fc481576-6f7f-461b-b8f2-5cbf7fcec0bc">

---------

Co-authored-by: Shrinks99 <Shrinks99@users.noreply.github.com>
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
2024-12-05 14:17:04 -08:00
Henry Wilkinson
f3ed70a1db
Add site_url (#2130)
### Changes

- Tells MkDocs where the site will be published at allowing it to
generate a sitemap

---------

Co-authored-by: emma <hi@emma.cafe>
2024-12-04 21:56:19 +00:00
Emma Segal-Grossman
c385b1404c
Translations update from Hosted Weblate (#2200) (#2201)
Translations update from [Hosted Weblate](https://hosted.weblate.org)
for [Browsertrix/Browsertrix
UI](https://hosted.weblate.org/projects/browsertrix/browsertrix-ui/).



Current translation status:

![Weblate translation

status](https://hosted.weblate.org/widget/browsertrix/browsertrix-ui/horizontal-auto.svg)

Co-authored-by: Weblate (bot) <hosted@weblate.org>
2024-12-03 18:02:36 -05:00
Emma Segal-Grossman
dc6e6c5e14
Resolve Weblate conflicts (#2199)
Translated using Weblate (Spanish)

Currently translated at 1.4% (18 of 1227 strings)

Translation: Browsertrix/Browsertrix UI
Translate-URL:
https://hosted.weblate.org/projects/browsertrix/browsertrix-ui/es/

Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
2024-12-03 17:47:06 -05:00
Emma Segal-Grossman
683e531cc0
Localize durations on frontend (#2196)
Partially addresses
https://github.com/webrecorder/browsertrix/issues/2171

- [x] Reimplement `pretty-ms`'s rounding logic to convert to a
`Intl.DurationFormat`-compatible object
- [x] Add `localize.duration` and `localize.humanizeDuration` methods
- [x] Replace `pretty-ms` usage with localized formatting
- [x] Add `Intl.DurationFormat` polyfill
- [x] Update localize tests
- [x] Fix broken tests (thank you @SuaYoo!)
- This looks to be possibly a bug somewhere in the web test runner's
code? Have yet to figure this one out
- Might be related to these:
https://github.com/web-dev-server/web-dev-server/issues/1
https://github.com/guybedford/es-module-lexer/issues/82 — both closed
with no comments or resolution 🙃 — `es-module-lexer` seems to be most
likely, given it's a native module & might be handling unicode sequences
incorrectly or not at all?
- [x] Clean up messy `index.d.ts` — probably split this out? The
definitions haven't yet made their way into `esnext`
https://github.com/microsoft/TypeScript/issues/60608

---------

Co-authored-by: emma-sg <emma-sg@users.noreply.github.com>
Co-authored-by: sua yoo <sua@suayoo.com>
2024-12-03 16:46:57 -05:00
sua yoo
2c2b8227d9
fix: Fix debounced inputs (#2191)
Fixes https://github.com/webrecorder/browsertrix/issues/2190

## Changes

- Fixes not being able to add live exclusion
- Fixes not being able to delete last exclusion
- Fixes collection list search
- Refactors exclusion form event name
2024-12-02 17:04:40 -08:00
Ilya Kreymer
99115473e5
Docs: Add API Reference as top-level nav (#2180)
can either link to redoc hosted elsewhere or make a local copy:
- for local frontend build, just redirect to
http://localhost:30870/api/redoc
- for deployment, make local copy: run copy-api-docs.sh, copy locally
from prod and serve at /api/
- copy-api-docs.sh copies openapi.json, redoc and logo to /api/ dir
- if analytics enabled, also injects analytics scripts
- for local testing, run copy-api-docs.sh and then run mkdocs serve
- ci: copy from prod server
- fixes #1582
2024-11-27 17:00:54 -08:00
Tessa Walsh
661e5d9fae
Fix issue with failed background job emails not being sent (#2187)
Fixes #2186 

Background job emails will no longer fail to send for jobs unrelated to
file replication or replica deletion.

Also uses `AnyJob` for paginated background job response model, to fix
typing being out of data following addition of other types of background
jobs and lower overhead for adding new ones moving forward.
2024-11-27 17:00:35 -08:00
sua yoo
292176da2c
feat: Update subscription strings (#2185)
- Separates translatable html strings into parts to make them easier to
translate
- Updates copy regarding subscription
- Updates plan feature list to match website
2024-11-27 14:27:05 -08:00
Ilya Kreymer
50dac7dc50
1.12.2 release -> main (#2181)
Merge 1.12.2 release changes into main, includes:
- Collection replay full refresh on metadata / archived items (#2176)
- Fix for self-registration default org (#2178)
- Prepend missing https in start URL (#2177)
- Updated billing to support free trial messaging (#2179)

---------

Co-authored-by: sua yoo <sua@webrecorder.org>
Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
Co-authored-by: sua yoo <sua@suayoo.com>
Co-authored-by: SuaYoo <SuaYoo@users.noreply.github.com>
2024-11-26 11:17:07 -08:00
sua yoo
37c0b06622
feat: Localize dates, bytes, and numbers (#2146)
- Defaults to user's browser language preference when displaying dates,
bytes, and numbers (with caveats.) This fixes an issue where numbers
were always formatted in English.
- Shows user's browser language preferences in language dropdown
- Fixes timezone not displayed in archived item detail start and finish
times
- Standardizes number formatting
- Sets timezone that unit tests run in

---------

Co-authored-by: SuaYoo <SuaYoo@users.noreply.github.com>
Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
Co-authored-by: emma-sg <emma-sg@users.noreply.github.com>
2024-11-19 21:49:02 -08:00
sua yoo
189a86d98d
Merge pull request #2140 from weblate/weblate-browsertrix-browsertrix-ui
Translations update from Hosted Weblate
2024-11-19 21:15:55 -08:00
sua yoo
8fb37c821a
Merge branch 'main' into weblate-browsertrix-browsertrix-ui 2024-11-19 21:15:34 -08:00
Tessa Walsh
ba5ca3fdd9
Move org storage recalculation into background job (#2138)
Fixes #2112 

- Moves org storage recalculation to background job, modify endpoint to
return job id as part of response
- Updates crawl + QA backend tests that broke due to
https://webrecorder.net website changes

---------

Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
2024-11-19 17:32:57 -05:00
sua yoo
333ab6d9e9
fix: Check password strength on password auto-fill (#2148)
Fixes password strength not being checked when new passwords are
auto-filled, resulting in submit buttons remaining disabled.

---------

Co-authored-by: SuaYoo <SuaYoo@users.noreply.github.com>
Co-authored-by: emma <hi@emma.cafe>
2024-11-19 13:47:24 -08:00
sua yoo
2f3dff3de5
fix: Fix app not loading for browsers without adoptedStyleSheets support (#2163)
Adds polyfill for `replaceSync` and `adoptedStyleSheets` support.
2024-11-19 13:46:52 -08:00
Emma Segal-Grossman
8ba18f2360
[Docs]: Only enable Plausible on deployment builds (#2162)
Tested locally.
2024-11-19 12:55:10 -05:00
Emma Segal-Grossman
0cbc279773
[Docs]: Fix edit URLs and update instructions for running docs locally (#2161)
- Adds a missing `/docs` to the docs edit urls
- Adds instructions for installing `mkdocs-material` with pipx & uvx,
and describes correct place to run `mkdocs serve` from
- Fixes edit url, opens in a new tab
- Adds Plausible

---------

Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
2024-11-19 00:43:22 -05:00
sua yoo
2cf75bd3f0
v1.12.1 release changes (#2155)
- Fix collection dialog visibility (#2147) and button (#2154)
2024-11-18 10:38:26 -08:00
sua yoo
ab9edfa064
feat: Add details on translation status (#2139)
languages specified in `translatedLocales`
- Updates user language preference beta badge text
- Adds link to translation contribution docs
- Refactors component name

---------

Co-authored-by: SuaYoo <SuaYoo@users.noreply.github.com>
Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
Co-authored-by: emma <hi@emma.cafe>
2024-11-12 13:59:34 -08:00
sua yoo
0fb6571990
refactor: Migrate LiteElements (#2145)
- Migrates the following `LiteElement`s to `BtrixElement`:
  - `App` (`<browsetrix-home>`)
  - `Admin` (`<btrix-home`)
  - `Dashboard` (`<btrix-dashboard>`)
  - `LogInPage` (`<btrix-log-in>`)
- Replaces custom light DOM `btrix-input` with `sl-input` since password
managers should work now.
2024-11-12 13:56:37 -08:00
sua yoo
6aaf9c985e
refactor: Implement brand colors (#2141)
- Pull colors from hickory tailwind theme
- Minor updates to buttons to match website branded buttons
2024-11-12 08:54:11 -08:00
Webrecorder Dev
cbcdd299bb
Translated using Weblate (Spanish)
Currently translated at 1.2% (15 of 1216 strings)

Translation: Browsertrix/Browsertrix UI
Translate-URL: https://hosted.weblate.org/projects/browsertrix/browsertrix-ui/es/
2024-11-12 16:43:41 +00:00
Henry Wilkinson
d1dbbbe53c
Add missing navigation button icons (#2144)
- Adds navigation button icons to the workflow details and org settings
2024-11-12 11:43:37 -05:00
sua yoo
c35dc7dd3e
gh: remove localization build workflow 2024-11-11 16:04:55 -08:00
sua yoo
3493067d92
gh: run localization build on merge to main 2024-11-11 14:12:45 -08:00
sua yoo
e4b5173fdc
gh: add workflow dispatch to localization build 2024-11-11 14:02:56 -08:00
sua yoo
19afb2f38f
gh: remove localization build condition 2024-11-11 14:01:54 -08:00
sua yoo
60fb874912
chore: Automatically output translation files on weblate PR (#2137)
Runs `lit-localize build` when a Weblate PR is approved.
2024-11-11 13:53:01 -08:00
sua yoo
5062ec11c9
feat: Allow users to specify language preference (#2129)
- Shows language selector on log in page
- Adds tabs to account settings
- Adds language preference selector on account settings
- Adds issue template for new language
- Updates dev docs for frontend localization

---------

Co-authored-by: SuaYoo <SuaYoo@users.noreply.github.com>
Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
2024-11-11 09:30:20 -08:00