Commit Graph

1654 Commits

Author SHA1 Message Date
sua yoo
573d8ca316
devex: Document workflow table components (#2558)
- Documents the following components in Storybook:
  - `btrix-data-table`
  - `btrix-table`
  - `btrix-crawl-log-table`
  - `btrix-custom-behaviors-table`
  - `btrix-link-selector-table`
  - `btrix-queue-exclusion-table`
  - `btrix-queue-exclusion-form`
- Refactors `btrix-table` and subcomponents to simplify CSS properties
- Fixes crawl exclusion table delete button not rendering
- Fixes Shoelace assets not loading Storybook
2025-04-23 19:31:34 -07:00
Tessa Walsh
f34b42cb59
Add custom behavior docs to user guide (#2559) 2025-04-23 14:27:39 -04:00
Emma Segal-Grossman
76ab3e7eaa
Add grid view to collection list (#2403)
Closes #2498 

Yay for consistency!

## Changes

Adds a grid view to the collections list, alongside the default list
view.

- Refactors edit dialog into `collections-grid-with-edit-dialog`
component for dashboard — collections list already has its own edit
dialog, so no need for this to be duplicated in the grid component
- Adds getter/setter for `page` property of pagination component, which
fixes the dashboard not switching back to page 1 when switching between
"Public" and "All" collection views

## Manual testing

1. On the collections list page, click between "View as Grid" and "View
as List" in the toolbar
2. Verify that pagination, the collection editing dialog, and the action
menu works in grid view
3. On the dashboard in an org with multiple pages of collections, switch
to the second page of "All" collections, then switch back to "Public"
collections. Verify that the page search param disappears when switching
between views.

## Screenshots

| Page | Screenshot |
|--------|--------|
| Collection list | <img width="1282" alt="Screenshot 2025-04-17 at 3 46
55 PM"
src="https://github.com/user-attachments/assets/f6dff74f-d56e-48f6-8d44-11b84bacbafb"
/> |
| Collection list (detail) | <img width="165" alt="Screenshot 2025-04-17
at 3 46 29 PM"
src="https://github.com/user-attachments/assets/3442c5e4-a67f-46a2-b475-ee4d3d1e0259"
/> |

---



Remaining things to do:
- [x] Add full actions menu from list view to grid view, instead of just
having pencil icon
- [x] Reuse collection editing dialog from existing list view, instead
of the grid view having its own separate dialog instance
2025-04-23 14:08:50 -04:00
sua yoo
78e2dadf0a
devex: Add Storybook for component development (#2556)
Adds Storybook in preparation for UI component refactoring.
2025-04-21 13:06:31 -07:00
sua yoo
c2a11ccf10
deps: Upgrade main frontend dependencies (#2551)
- Upgrades typescript-eslint to a more performant version and related
dependencies. Note that these dependencies were not upgraded to the
latest version to avoid upgrading to eslint 9 at this time.
- Upgrades Lit one minor version
2025-04-15 13:31:50 -07:00
Emma Segal-Grossman
224f34e288
Update to docker/setup-buildx-action@v3 (#2553)
## Changes
- Updates `docker/setup-buildx-action` from v2 to v3
- This should fix the intermittent build error seen here:
https://github.com/webrecorder/browsertrix/actions/runs/14362787038/job/40268326912?pr=2538
- The breaking change from v2 to v3 is the minimum node version is
updated to 20, which is already the minimum version we use
- Relevant buildx issue here:
https://github.com/docker/buildx/issues/681
2025-04-09 21:42:45 +02:00
sua yoo
f2e6892729
fix: Update custom behavior file placeholder text (#2552)
Follows https://github.com/webrecorder/browsertrix/issues/2151

## Changes

Updates placeholder text for custom behavior files, since we now accept
JSON.
2025-04-09 21:41:53 +02:00
Emma Segal-Grossman
eeda4cd9ff
Persist pagination state in url (#2538)
Closes #1944 

## Changes
- Pagination stores page number in url search params, rather than
internal state, allowing going back to a specific page in a list
- Pagination navigation pushes to history stack, and listens to history
changes to be able to respond to browser history navigation
(back/forward)
- Search parameter reactive controller powers pagination component
- Pagination component allows for multiple simultaneous paginations via
custom `name` property

## Manual testing

1. Log in as any role
2. Go to one of the list views on an org with enough items in the list
to span more than one page
3. Click on one of the pages, and navigate back in your browser. The
selected page should respect this navigation and return to the initial
numbered page.
4. Navigate forward in your browser. The selected page should respect
this navigation and switch to the numbered page from the previous step.
5. Click on a non-default page, and then click on one of the items in
the list to go to its detail page. Then, using your browser's back
button, return to the list page. You should be on the same numbered page
as before.

---------

Co-authored-by: sua yoo <sua@suayoo.com>
2025-04-09 15:40:30 -04:00
sua yoo
b0d1a35563
fix: Handle no crawling defaults (#2549)
Fixes regression introduced by
7c6bae8d61

## Changes

Handles orgs without any crawl defaults correctly. Areas that use
crawling defaults are also more strongly typed now to prevent similar
issues.
2025-04-09 12:48:12 -04:00
Ilya Kreymer
0cb3bd19f6 version: update to 1.15.0 2025-04-09 12:28:01 +02:00
sua yoo
7c6bae8d61
feat: Add custom behaviors to org crawling defaults (#2546)
Resolves https://github.com/webrecorder/browsertrix/issues/2513

## Changes

- Allows org admins to set custom behaviors as crawling defaults
- Shows warning text if both autoscroll/autoclick and custom behaviors
are enabled
- Refactors `infoTextStrings` -> `infoTextFor` to match other
label/string matchers

---------

Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
2025-04-09 04:10:30 -04:00
Emma Segal-Grossman
0a0d2d04d3
Add basic opengraph & twitter card tags & image to browsertrix root (#2547)
Closes #2480 

Put together a quick opengraph (OG) image for Browsertrix: 

![browsertrix-og](https://github.com/user-attachments/assets/355aa810-3a3a-46b4-b43a-1a894fae8a6e)
2025-04-08 19:23:26 -04:00
sua yoo
58749602ff
Move custom behaviors behind checkbox (#2545)
WIP for https://github.com/webrecorder/browsertrix/issues/2541

## Changes

- Moves custom behaviors table to behind "Use Custom Behaviors"
checkbox.
- Updates autoclick selector to match checkbox reveal layout.
- Adds minimum viable user guide documentation of custom behaviors.
2025-04-09 00:16:02 +02:00
sua yoo
ba57b85322
feat: Display behavior logs (#2531)
- Displays behavior logs wherever error logs are shown
- Makes page URL in detail dialog clickable rather than in row column to
prevent accidental navigation
- Rename "Download Logs" -> "Download All Logs" and add tooltip with
additional context

---------

Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
2025-04-08 14:38:59 -07:00
Tessa Walsh
785fd85105
Ensure error and behavior logs are written to database in order (#2540)
Fixes #2539
2025-04-08 09:35:50 -04:00
Tessa Walsh
55bedcb0b7
feat: Custom autoclick selector (#2517)
Resolves #2504

## Changes

- Allows users to customize autoclick selector in workflows
- Refactors `btrix-syntax-input` to support rendering label and help
text `sl-input`
- Show autoclick selector in workflow / crawl settings
- Adds 'clickSelector' with default of 'a' to backend crawl config.

---------

Co-authored-by: sua yoo <sua@suayoo.com>
Co-authored-by: sua yoo <sua@webrecorder.org>
Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
2025-04-08 05:53:40 +02:00
sua yoo
0aaae17110
fix: Enable saving workflow with default select links (#2537)
Allows users to save a workflow with an empty "Link Selectors" table,
using the default value. This is aligned with how we use default values
for other empty inputs, and prevents a case where a user may
inadvertently removed a row and now cannot save a workflow with the
default link selector.

Also updates the info text to show the default value.
2025-04-07 19:19:36 -07:00
Tessa Walsh
a51f7c635e
Add behavior logs from Redis to database and add endpoint to serve (#2526)
Backend work for #2524

This PR adds a second dedicated endpoint similar to `/errors`, as a
combined log endpoint would give a false impression of being the
complete crawl logs (which is far from what we're serving in Browsertrix
at this point).

Eventually when we have support for streaming live crawl logs in
`crawls/<id>/logs` I'd ideally like to deprecate these two dedicated
endpoints in favor of using that, but for now this seems like the best
solution.

---------

Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
2025-04-08 02:16:10 +02:00
Tessa Walsh
f84f6f55e0
Add basic backend validation for selectLinks (#2510)
Follow-up to #2152 

Related to https://github.com/webrecorder/browsertrix/pull/2487

This PR provides very basic validation of the `config.selectLinks`
argument on workflow creation and update. Namely, it checks that:
- `config.selectLinks` is not an empty array
- Each entry consists of two non-empty text sequences separated by `->`

At this point we're not validating the actual CSS selector on the
backend, though we could add that down the road.

Tests have been added accordingly.

Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
2025-04-07 21:36:05 +02:00
sua yoo
23f9e08a22
feat: Add custom behaviors to workflow (#2520)
Resolves https://github.com/webrecorder/browsertrix/issues/2151
Follows https://github.com/webrecorder/browsertrix/pull/2505

## Changes

- Allows users to set custom behaviors in workflow editor.
- Allows one or more behaviors, as simple URL or Git URL to be added
- Calls validation endpoint to check if URL is valid.

---------

Co-authored-by: emma <hi@emma.cafe>
2025-04-02 17:45:27 -07:00
Tessa Walsh
cd7b695520
Add backend support for custom behaviors + validation endpoint (#2505)
Backend support for #2151 

Adds support for specifying custom behaviors via a list of strings.

When workflows are added or modified, minimal backend validation is done
to ensure that all custom behavior URLs are valid URLs (after removing
the git prefix and custom query arguments).

A separate `POST /crawlconfigs/validate/custom-behavior` endpoint is
also added, which can be used to validate a custom behavior URL. It
performs the same syntax check as above and then:
- For URL directly to behavior file, ensures URL resolves and returns a
2xx/3xx status code
- For Git repositories, uses `git ls-remote` to ensure they exist (and
that branch exists if specified)

---------

Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
2025-04-02 16:20:51 -07:00
Ilya Kreymer
c067a0fe7c
fix qa page sorting: (#2530)
was sorting on qa.{qa_run_id} after the value was already replaced with
'qa', thus was sorting on non-existent value
fixes #2529
2025-04-02 09:25:38 -07:00
sua yoo
f6481272f4
feat: Specify custom link selectors (#2487)
- Allows users to specify page link selectors in workflow "Scope"
section
- Adds new `<btrix-syntax-input>` component for syntax-highlighted
inputs
- Refactors highlight.js implementation to prevent unnecessary language
loading
- Updates exclusion table header styles

---------

Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
2025-04-02 00:32:34 -07:00
Ilya Kreymer
b5b4c4da15 version: update to 1.14.8 2025-03-31 14:17:53 -07:00
Ilya Kreymer
62e47a8817
support overriding crawler image pull policy per channel (#2523)
- add 'imagePullPolicy' field to each crawler channel declaration
- if unset, defaults to the setting in the existing
'crawler_image_pull_policy' field.

fixes #2522

---------

Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
2025-03-31 14:11:41 -07:00
sua yoo
df8c80f3cc
task: Display built-in behaviors as list (#2518)
- Displays built-in behaviors as single field in workflow settings
- Standardizes how "None" is displayed in workflow settings
- Refactors behavior names into enum
2025-03-26 17:09:02 -07:00
Ilya Kreymer
61809ab3c5 ci: typo fix, move 'workflow_dispatch' to correct place 2025-03-26 13:02:38 -07:00
Ilya Kreymer
0925da6768
CI: Update python version + script (#2521)
Ensure we're on the latest versions CI actions + python (except lint check, due to issue)
Also allow running the Microk8s tests on demand with workflow dispatch
2025-03-26 12:53:18 -07:00
Ilya Kreymer
b3950dd03f version: update to 1.14.7 2025-03-25 17:25:24 -07:00
Ilya Kreymer
9250befea4
ingress: remove X-Forward-Proto snippet, no longer needed (and now possibly considered unsafe) (#2519)
X-Forward-Proto is now already provided by the standard ingress-nginx config
2025-03-25 17:24:55 -07:00
Ilya Kreymer
21a372057b
Fix user emails use userout (#2511)
Follow-up to #2495, actually ensure org subscription data is in included
in admin email response

---------

Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
2025-03-24 12:04:39 -07:00
Ilya Kreymer
46be6a0cf6 version: bump to 1.14.6 2025-03-20 16:52:20 -07:00
Henry Wilkinson
c797e8446d
docs: Add UI documentation page on status icons (#2506)
### Changes
- Adds status icons page
- Moves action menus page to the UI development docs folder
- Fixes sentence fragment
2025-03-20 16:51:20 -07:00
Henry Wilkinson
c770b9ec22
frontend: move name field to the top of the signup form (#2508)
Fixes #2507

Does what it says on the tin!
2025-03-20 16:50:43 -07:00
Ilya Kreymer
4c0ddd0fe3
crawl replay: remove isSeed=true from initialPages query (#2509)
- matches initial query for collections
- fixes 'Show Non-Seed Pages' not appearing for crawl replay
2025-03-20 15:03:41 -07:00
Ilya Kreymer
cb14ac3a00
add org subs info to /api/users/emails endpoint (#2495)
Include additional info in this superadmin-only endpoint.
2025-03-20 08:31:23 -07:00
Ilya Kreymer
b63caf74ad
cleanup unused chart values + change mongo default (#2484)
- Removes chart values that are unused
- Also change `local-mongo.default` -> `local-mongo`,
`local-minio.default` -> `local-minio` as some users have reported
issues with `.default` and it will certainly break if not deploying
Browsertrix in the `default `namespace.
2025-03-20 08:30:45 -07:00
Henry Wilkinson
cf6690e74a
docs: add development section on action menus (#2429)
Closes #2428
2025-03-19 18:46:09 -04:00
Ilya Kreymer
c9c32d86e2
login: don't set default slug if user not part of any orgs #2491 (#2492)
if logged in user is not part of any orgs, still allow logging in,
instead of throwing an exception due to accessing non-existent org

---------

Co-authored-by: sua yoo <sua@suayoo.com>
2025-03-19 15:23:16 -07:00
sua yoo
0bc210d905
devex: Add frontend code snippet & update dev docs (#2494)
- Adds VSCode file template for component unit testing.
- Updates development docs with details on UI dev
2025-03-19 14:22:20 -07:00
Emma Segal-Grossman
b471192cbc
Workflow editor footer button: ensure isCrawlRunning is false if editing a new workflow (#2496)
Reported by @tw4l 

Quick fix for the bug I introduced in 1bc3c35 in #2481. I didn't
properly test on the workflow editor in a "new workflow" state, and
didn't realize that the component that fetches the workflow state for an
existing workflow wouldn't be rendered for a new workflow, so the update
to the loading state never occurred for new workflows. This fix
explicitly sets `isCrawlRunning` to `false` instead of `null` for new
workflows, so that the loading state isn't displayed.

Tested locally with both new and existing workflows (in both non-running
and running states).
2025-03-19 15:44:16 -04:00
Ilya Kreymer
6be1f6674c
fixes token lifetime bug / improve security (#2490)
- fix jwt_token_lifetime being in hours, not minutes, remove extra * 60
- don't return userids in user list for org admins, instead just key
users by email, which is already unique
2025-03-19 10:07:09 -07:00
Ilya Kreymer
eb300815a7
Fixes #2488 (#2493)
- Fixes #2488 
- Adds a k8s api call to set `suspend=false` on Job when associated
CrawlJob is finished.
- bump version - released as 1.14.5
2025-03-19 10:06:25 -07:00
sua yoo
d2601a037e
feat: Show running crawl when editing workflow (#2481)
Part of https://github.com/webrecorder/browsertrix/issues/2366

## Changes

- Displays latest running crawl status when editing workflow
- Disables "Run Now" button if crawl is currently running

Currently, clicking "Run Now" will result in a preventable server error
if the crawl is already running. The change in this PR is in preparation
for being able to update a currently running crawl and doesn't require
any backend changes.

## Manual testing

1. Log in as crawler
2. Go to edit crawl workflow
3. Open same workflow in another tab
4. Run the workflow
5. Go back to edit tab. Verify "Starting" status is shown next to "Save"
button and "Run Crawl" button is disabled

## Screenshots

| Page | Image/video |
| ---- | ----------- |
| Edit Workflow | <img width="354" alt="Screenshot 2025-03-11 at 1 34
07 PM"
src="https://github.com/user-attachments/assets/02f7fb4a-219d-43a4-bb1f-1f2b40ac1480"
/> |


<!-- ## Follow-ups -->

---------

Co-authored-by: emma <hi@emma.cafe>
2025-03-18 18:54:04 -04:00
Emma Segal-Grossman
89a6e84377
Fix broken thumbnail images not taking up appropriate size on ff (#2486)
Closes #2485 

Also adds alt text to collection thumbnail images.
2025-03-18 18:53:10 -04:00
sua yoo
bcb73932d4
docs: Organize readme and fix doc links (#2479)
Resolves https://github.com/webrecorder/browsertrix/issues/2478

## Changes

- Organizes README
- Fixes relative links in mkdocs

---------

Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
2025-03-11 18:37:20 -07:00
Emma Segal-Grossman
b2c5b9bc59
Hide breadcrumbs for private orgs (#2477)
Hides "Back to [org name]" breadcrumb when viewing a public/unlisted
collection when the public gallery isn't enabled for the org (except
when logged into that org).
2025-03-11 15:05:35 -04:00
sua yoo
ac1236f15b
feat: Add behaviors section to workflow form (#2464)
- Moves "Per-Page Limits" fields to new "Page Behavior" section
- Fixes workflow settings closing tags with refactor to how sections are
rendered
- Updates user guide with behaviors documentation

---------

Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
2025-03-11 11:40:20 -07:00
emma
a42d83c9f6
add content-length and etag headers to thumbnail endpoint 2025-03-10 13:58:41 -04:00
Ilya Kreymer
d8365c734f version: bump to 1.14.4 2025-03-08 15:58:18 -08:00