Commit Graph

1204 Commits

Author SHA1 Message Date
Tessa Walsh
b7631d1b91
Add slug validation and test (#1891)
Fixes #1890 

Adds validation for org slugs, ensuring that they contain only ASCII
alphanumeric characters and dashes (`-`). If an invalid slug is
provided, an HTTPException is returned with status code 400 and detail
`invalid_slug`.
2024-06-26 15:04:54 -04:00
Ilya Kreymer
6df10d5fb0
Improved Scale Handling (#1889)
Fixes #1888 

Refactors scale handling:
- Ensures number of scaled instances does not exceed number of pages,
but is also at minimum 1
- Checks for finish condition to be numFailed + numDone >= desired scale
- If at least one instance succeeds, crawl considers successful / done.
- If all instances fail, crawl considered failed
- Ensures that pod done count >= redis done count

---------
Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
2024-06-26 10:24:45 -07:00
Tessa Walsh
9140dd75bc
Add and enforce readOnly field in Organization (#1886)
Fixes https://github.com/webrecorder/browsertrix/issues/1883
Backend work for https://github.com/webrecorder/browsertrix/issues/1876

- If readOnly is set true, disallow crawls and QA analysis runs
- If readOnly is set to true, skip scheduled crawls
- Add endpoint to set `readOnly` with optional `readOnlyReason` (which
is automatically set back to an empty string when `readOnly` is being
set to false), which can be displayed in banner
- Operator: ensures cronjobs that are skipped due to internal logic (eg. readonly mode) simply succeed right away and do not leave a k8s job dangling.

---------
Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
2024-06-25 19:30:53 -07:00
Henry Wilkinson
48dfa485e5
Adds GitHub and Forum to the email invite template (#1887)
- Adds Browsertrix GitHub repo and Webrecorder forum to the bottom of
the support email.
- Adds note about having an applicable plan to contact support

---------

Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
2024-06-25 19:27:03 -04:00
Ilya Kreymer
3bd714ea9d
QA stats aggregation: exclude isFile / isError pages from stats (#1879)
Follow-up to: #1868, exclude pages that have isFile or isError set to
true from the stats aggregation.
2024-06-25 08:54:42 -07:00
Tessa Walsh
7af3980323
Add billing enabled and sales email to Helm chart and /settings API endpoint (#1873)
Backend work for first two tasks of
https://github.com/webrecorder/browsertrix/issues/1875

New /billing API endpoint to be added separately once we have a better
idea of what data we can get from the payment processor.
2024-06-25 10:55:29 -04:00
Emma Segal-Grossman
a7382ebb98
Use internal rounded bar in <btrix-meter> for QA analysis meters (#1869)
Closes #1851 

This changes how we use the `<btrix-meter>` component: previously, we
didn't set a `max` value on it, so it was drawing its internal (rounded)
bar at 100% of the meter width, and then drawing the
`<btrix-meter-bar>`s inside that 100% width bar. This changes that, and
instead it now does the following:

- Draws the internal rounded bar to the width of the proportion of their
counts to the total page count;
- Adjusts the `<btrix-meter-bar>`s to be proportional to the completed
page count rather than the total page count
- Uses the `"available"` slot in `<btrix-meter>` to draw the remaining
"No data" bar & tooltip in the remaining space outside of the internal
rounded bar

This also includes a couple unrelated but adjacent changes:

- Changes the page count text to say "Analysis starting" when the
analysis run is starting, because there's no meaningful page count at
that point.
- Uses the pending state when the total page count is falsy (`undefined`
or `0`), rather than just `undefined`
2024-06-21 22:40:56 -07:00
Tessa Walsh
879e509b39 Backend: Move page file and error counts to crawl replay.json endpoint (#1868)
Backend work for #1859

- Remove file count from qa stats endpoint
- Compute isFile or isError per page when page is added
- Increment filePageCount and errorPageCount per crawl to count number of isFile or isError pages
- Add file and error counts to crawl replay.json endpoint (filePageCount and errorPageCount)
- Add migration 0028 to set isFile / isError for each page, aggregate filePageCount / errorPageCount per crawl
- Determine if page is a file based on loadState == 2, mime type or status code and lack of title
2024-06-20 19:02:57 -07:00
Ilya Kreymer
16a720c685
1.10.2 release merge (#1866)
Merge 1.10.2 release into 1.11.0-beta.0
2024-06-13 00:42:27 -07:00
Ilya Kreymer
553e2e352b
Merge branch 'main' into 1.10.2-release 2024-06-12 23:59:56 -07:00
Henry Wilkinson
dc9069d1bf
Improves accessibility for QA features (#1863)
- Switches from spans with classes to `ins` and `del` tags for text
comparison
- Adds `aria-label` attributes for screen readers. Text comparison is
accessible now! 🎉
- I kept the strikethrough text on the `del` tag but can remove? Only
visible on hover.
- Removes autofocus on the delete analysis run cancel button
- Adds `aria-label` attribute for the heuristic nav bar to describe the
context of the content users will be seeing on each page.
2024-06-12 21:32:43 -04:00
sua yoo
f8cde4bd76
fix: Show correct max depth in settings (#1858)
Fixes https://github.com/webrecorder/browsertrix/issues/1626
2024-06-12 15:05:01 -05:00
Ilya Kreymer
fa6627ce70
ensure QA configmap is updated for long running QA runs: (#1865)
- add a 'expire_at_duration_seconds' which is 75% of actual presign
duration time, or <25% remaining until presigned URL actually expires to
ensure presigned URLs are updated early than when they actually expire
- set cached expireAt time to the renew at time for more frequent
updates
- update QA configmap in place with updated presigned URLs when expireAt
time is reached
- mount qa config volume under /tmp/qa/ without subPath to get automatic
updates, which crawler will handle
- tests: fix qa test typo (from main)
- fixes #1864
2024-06-12 10:51:35 -07:00
Tessa Walsh
8b0d1432af
Show QA meter while analysis is running (#1854)
Fixes #1846 

- Ensure meter auto-updates as new stats are ready
- Switch meter to new QA run when new analysis run is started
- Remove Files from QA meter (files and errors will be reported separately)

Co-authored-by: emma <hi@emma.cafe>
Co-authored-by: sua yoo <sua@webrecorder.org>
2024-06-12 12:32:01 -04:00
sua yoo
9d69001c23
fix: Prevent ReplayWeb.Page shoelace components from impacting browsertrix (#1861)
Resolves https://github.com/webrecorder/browsertrix/issues/1836
Related to https://github.com/webrecorder/replayweb.page/pull/329

<!-- Fixes #issue_number -->

### Changes

Loads `replay/ui.js` after the browsertrix-app component is defined to
prevent browsertrix from using buttons defined by replayweb.page
shoelace imports. This was the most evident in button group styles not
being applied.
2024-06-12 09:20:49 -07:00
Henry Wilkinson
3de2e486b1
Reorder sections to match workflow creator (#1862) 2024-06-12 11:46:15 -04:00
sua yoo
d501fb3fe7
fix: Correct progress ring for analysis run in Chrome (#1860)
Switches `sl-progress-ring` and `sl-icon` to inherit font size from
table cell for consistent sizing as base size, while also fixing
`var(--font-size-base)` not being available when progress ring size is
first calculated.

Fixes #1835
2024-06-12 09:51:16 -05:00
Ilya Kreymer
1ab6ec325b version: bump to 1.10.2 2024-06-11 16:28:40 -07:00
Ilya Kreymer
2ffb37bd14
tests: fix typo in waiting for qa run to stop test! (#1857)
Fixes not properly testing if activeQA is null, hopefully fixes
intermittent test failures!
2024-06-11 11:07:55 -04:00
Tessa Walsh
a03bc06473
Add button to QA Latest Crawl to Watch tab (#1856) 2024-06-10 12:46:04 -04:00
Tessa Walsh
4edc05d503
Use standard firstSeed/seedCount fallback for workflows with no name in profile details (#1852)
Fixes #1833 

- Add firstSeed and seedCount to workflow information in profile detail
API endpoint (tests updated accordingly), update name of model used for
limited workflow information to be more accurate
- Fix name display in Crawl Workflows list at bottom of Profile detail
page to be consistent with rest of application

---------

Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
2024-06-06 14:28:19 -04:00
Tessa Walsh
a85f9496b0
Include number of Identical Files in QA stats and meter (#1848)
This PR adds Identical Files to the QA Page Match Analysis meter bars.
To do this, the backend calculates the number of non-HTML pages once and
includes it under the key `Files` in each of the `screenshotMatch` and
`textMatch` QA stats return arrays.

The backend additionally removes the file count from "No Data" to
prevent these from being counted twice.

---------

Co-authored-by: emma <hi@emma.cafe>
2024-06-06 13:15:19 -04:00
Ilya Kreymer
e3ee63f9b0 version: bump to 1.11.0-beta.0 2024-06-04 13:37:44 -07:00
sua yoo
4d4c8a04d4
feat: User-sort browser profiles list (#1839)
Resolves https://github.com/webrecorder/browsertrix/issues/1409

### Changes

- Enables clicking on Browser Profiles column header to sort the table, including by starting URL
- More consistent column widths throughout app

---------

Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
Co-authored-by: emma <hi@emma.cafe>
Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
2024-06-04 13:57:03 -04:00
Henry Wilkinson
c2ce96c057
Move copy-field label outside of field (#1845)
Moves `copy-field` label outside of the div that contains the content
2024-05-31 20:24:09 -04:00
Ilya Kreymer
d42de92d75
QA analysis scale configurable in helm chart (#1843)
- allow configuring QA run scale via 'qa_scale' setting in helm values
(overriding any setting on the qa crawljob)
- adds additional comments to browser instances helm values settings for clarity
- fixes #1842
2024-05-30 12:59:21 -07:00
Henry Wilkinson
251aef3ac1
Docs: Elaborates on using user agents (#1841)
- Provides a link to Mozilla's page explaining what they are (good for
folks new to the concept)
- Provides a link to useragents.me, the same site we link to in the app
- Provides two examples of situations where they may be helpful to get
around content restrictions
2024-05-30 14:50:10 -04:00
Ilya Kreymer
b432d226bd
Profile UX tweaks + sync between new and edit workflows (#1840)
Follow up to #1815 

- Improved detection / responsiveness to unavailable browser
- Disable Save buttons when browser disconnected / unavailable
- Only add unload handler when browser is available
- Consistency between new and edit views: new profile view also has
cancel button with confirmation
- Don't show cancel confirmation if browser is already unavailable. 

Various text tweaks for consistency / accuracy:
- Save New Profile... to indicate new profile will be saved after dialog
- Load new browser to indicate new browser will be created
- Mention connection to browser is lost in disconnected message.

Also: migrated to LiteElement -> TailwindElement for browser-profiles-new

-------
Co-authored-by: emma <hi@emma.cafe>
2024-05-30 11:19:36 -07:00
sua yoo
aa6429049e
Display name of user who last updated browser profile (#1834)
- Shows browser profile last modified or created by name, if available
- Moves backed-up status to browser profile subsection header
- Moves "Last Updated" column to last and displays user name on hover,
to match archived items list view
- Updates browser profile docs
2024-05-29 13:40:56 -07:00
Ilya Kreymer
61239a40ed
include workflow config in QA runs + different browser instances for QA (#1829)
Currently, the workflow crawl settings were not being included at all in
QA runs.
This mounts the crawl workflow config, as well as QA configmap, into QA
run crawls, allowing for page limits from crawl workflow to be applied
to QA runs.

It also allows a different number of browser instances to be used for QA
runs, as QA runs might work better with less browsers, (eg. 2 instead of
4). This can be set with `qa_browser_instances` in helm chart.

Default qa browser workers to 1 if unset (for now, for best results)

Fixes #1828
2024-05-29 13:32:25 -07:00
Tessa Walsh
18e5ed94f1
Add migration to set profile modified date (#1832)
If modified field doesn't exist on older browser profiles, set it equal
to created date to match what we do for new profile creation.
2024-05-29 15:56:27 -04:00
sua yoo
523ad68880
Browser profile list and detail minor UX improvements (#1822)
- Paginates browser profile list view
- Moves back-up status icon to list view
- Display last updated date if available (fallback to created date)
- Adds max length validation to description
- Better handle description and crawl workflow list
2024-05-29 12:40:19 -07:00
Tessa Walsh
7e5d742fd1
Backend: Add modified field and track created/modifier users for profiles (#1820)
This PR introduces backend changes that add the following fields to the
Profile model:
- `modified`
- `modifiedBy`
- `modifiedByName`
- `createdBy`
- `createdByName`

Modified fields are set to the same as the created fields when the
resource is created, and changed when the profile is updated (profile
itself or metadata).

The list profiles endpoint now also supports `sortBy` and
`sortDirection` options. The endpoint defaults to sorting by `modified`
in descending order, but can also sort on `created` and `name`.

Tests have also been updated to reflect all new behavior.
2024-05-28 17:25:22 -04:00
Emma Segal-Grossman
6a94c64fa2
ensure loader fills image swiper, and only display loader when replay data is nullish, not when it's loaded but there's no image data (#1819)
Closes #1818 

- Refactors image renderers, and changes the condition for which the
loading indicator is displayed from "`<data>.blobUrl` exists and has a
truthey value" to "`<data>` is not nullish"
- Adds an additional class config to the shared QA loading indicator,
and uses it in the image slider view to add a background and aspect
ratio to the loading indicator's container so that it takes up the space
it should and has an opaque background

| Before | After |
| --- | --- |
| <img width="813" alt="Screenshot 2024-05-22 at 5 17 14 PM"
src="https://github.com/webrecorder/browsertrix/assets/5727389/fb8a3a83-a0c8-46c1-b59b-a59adff2a175">
| <img width="813" alt="Screenshot 2024-05-22 at 5 17 31 PM"
src="https://github.com/webrecorder/browsertrix/assets/5727389/6fe5d04a-ffa9-4fc3-bc3b-bdb9b7b30948">
|
2024-05-28 14:02:49 -04:00
sua yoo
8faf0adb55
UX improvements to browser profile editing & creating view (#1815)
Resolves https://github.com/webrecorder/browsertrix/issues/438

<!-- Fixes #issue_number -->

### Changes
- Layout and design pass on profile detail view to better match other
detail views
- Ensures profile save buttons are always visible when creating or
editing a profile
- Handle temporarily disconnected browser pings
- Enable recreating browser after it expires
- Show confirmation dialog when attempting to navigate away from active
browser
- Tweak copy referencing profiles
- Refactors `profile-browser` into `TailwindComponent`

### Follow-ups

UX improvements to the browser profile detail layout and list view will
be handled in https://github.com/webrecorder/browsertrix/issues/1816

---------
Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
2024-05-27 16:57:33 -07:00
Ilya Kreymer
85cd214101
Fix regression to changing user roles via PATCH /user-role API (#1824)
clean up adding user vs changing role logic:
- when adding user, ensure user doesn't exist
- when changing roles, ensure user does exist

add test for changing roles of existing user

Fixes #1821
2024-05-24 10:41:05 -07:00
Ilya Kreymer
4b6dd97c11 version: bump to 1.10.1 2024-05-23 22:24:58 -07:00
Emma Segal-Grossman
2c9ead718f
Misc UI fixes (primarily buttons) (#1814)
Closes #1813 

Before:


https://github.com/webrecorder/browsertrix/assets/5727389/b843f33a-6323-4a57-bc25-030582478a14

After:


https://github.com/webrecorder/browsertrix/assets/5727389/579200a0-cef2-4f49-8969-6fee1dfd07f5

<img width="156" alt="Screenshot 2024-05-21 at 7 25 42 PM"
src="https://github.com/webrecorder/browsertrix/assets/5727389/8235b8d2-5184-4d14-a4e7-b5969025f4f5">
2024-05-22 15:55:52 -04:00
sua yoo
0d53771a81
Fix editing browser profile metadata (#1812)
- Fixes browser profile metadata form submission
- Fixes rendering of browser profile description in list view
- Changes label to "metadata" for consistency with other features
2024-05-21 16:34:17 -07:00
Emma Segal-Grossman
040d1b70d4
Custom button cleanup & toolbar button styles (#1794)
Closes https://github.com/webrecorder/browsertrix/issues/1791



https://github.com/webrecorder/browsertrix/assets/5727389/54a4d9a2-9e68-4cbd-9cef-8a73a6106043

| Screenshots |
| --- |
| <img width="145" alt="Screenshot 2024-05-08 at 6 13 53 PM"
src="https://github.com/webrecorder/browsertrix/assets/5727389/35efd4b5-2a59-4fd2-8a62-904eedad98f9">
|
2024-05-21 13:28:41 -04:00
Ilya Kreymer
e853b62401 version: update to 1.10.0! 2024-05-20 19:30:22 -07:00
sua yoo
5c3b24fbf9
Fix newly created org missing from user's org list (#1799)
Resolves https://github.com/webrecorder/browsertrix/issues/1398

### Changes
- Updates org list in user info state after an org is created
- Minor refactor to add `btrix` prefix to custom `update-user-info`
event and replace unnecessary `defaultOrg` property
2024-05-20 19:27:19 -07:00
sua yoo
c5034e882d
Upgrade Shoelace for UI fixes (#1806)
Fixes https://github.com/webrecorder/browsertrix/issues/1802

<!-- Fixes #issue_number -->

### Changes

- Upgrades Shoelace to 2.15.0 for UI fixes including #1802 (See
https://github.com/shoelace-style/shoelace/blob/v2.15.0/docs/pages/resources/changelog.md)
- Refactors custom components that extend Shoelace components so that
shared shoelace `componentStyles` are included properly
2024-05-16 11:36:08 -07:00
sua yoo
24b20215d0
Allow superadmins to set role when inviting user (#1801)
- Adds user role select to superadmin dashboard
- Requires org selection (unless there's only one org) to prevent
accidental crawler invites to default testing org
- Shows link to org members after invite, retaining form for quick
re-invite
- Refactor `invite-form` into `TailwindComponent`
2024-05-15 19:47:23 -07:00
sua yoo
3b2e382ba0
Reorganize frontend build files (#1803)
Refactors config files so that `/config` can be included in Docker build.
2024-05-15 19:46:52 -07:00
Ilya Kreymer
3280f65680
frontend build check: build frontend docker image (#1804)
Build the docker image to ensure image builds correctly, partially replacing local install + build (though still running tests + lint outside docker)
2024-05-15 18:13:07 -07:00
Ilya Kreymer
1ca107fa2b
quickfix: fix for additional lint error in updated pylint (#1805) 2024-05-15 17:00:15 -07:00
sua yoo
0479489bd8
Allow users to configure offset when viewing crawl queued URLs (#1581) 2024-05-15 14:42:00 -07:00
Henry Wilkinson
1a668fe82f
Adds QA features to user docs (#1784)
Fixes #1695

### Changes
- Adds Crawl Review user docs
- Adds Quality Assurance section to the Archived Items page
- Adds note in the user roles list on crawl review not being available for viewers

Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
Co-authored-by: sua yoo <sua@webrecorder.org>
Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
2024-05-15 15:01:44 -04:00
Ilya Kreymer
94d57b98ce version bump to 1.10.0-beta.7 2024-05-15 11:30:05 -07:00