Commit Graph

975 Commits

Author SHA1 Message Date
Henry Wilkinson
05c5e09d25
Adds status information to user documentation (#1459)
Closes #1434 

### Changes
#### Developer
- Adds the K3S playbook guide to the navigation
- Adds note about restarting MKDocs when adding new icons
- Adds note about concise language to the styleguide ([see previous
discussion](https://github.com/webrecorder/browsertrix-cloud/pull/1394#discussion_r1402666872))
- Adds a note about noun usage to the styleguide
#### User guide
- Adds tables for archived item and workflow statuses
- Adds custom styles for displaying statuses with their icons like we do
in the app
- Fixes capitalization issues
---------

Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
Co-authored-by: sua yoo <sua@webrecorder.org>
2024-01-14 16:44:51 -08:00
Tessa Walsh
9f73bafd37
Fix browser profile name in crawl endpoints (#1464)
Fixes #1388 

Fixes browser profile name lookup by ensuring profileid is in CrawlOut
model.
2024-01-14 16:30:27 -08:00
Tessa Walsh
138e2da8b3
Add setup command to btrix helper to copy local config (#1462)
Fixes #1157 

Adds `./btrix setup` command to `btrix` helper which copies the example
local config to `./chart/local.yaml` where `btrix` expects it.

If another command is run when the local config file doesn't yet exist,
the helper will stop and suggest to the user to run `./btrix setup` and
edit the resulting file.
2024-01-10 19:32:39 -08:00
Tessa Walsh
38a01860b8
Add API endpoints for crawl statistics (#1461)
Fixes #1158 

Introduces two new API endpoints that stream crawling statistics CSVs
(with a suggested attachment filename header):

- `GET /api/orgs/all/crawls/stats` - crawls from all orgs (superuser
only)
- `GET /api/orgs/{oid}/crawls/stats` - crawls from just one org
(available to org crawler/admin users as well as superusers)

Also includes tests for both endpoints.
2024-01-10 13:30:47 -08:00
Emma Segal-Grossman
99dd9b4acb
Remove non-prod & optional dependencies when building frontend in ci (#1455)
Fixes #1454 

## Motivation

We've had a number of cases recently where a build dependency is added
to `devDependencies`, the PR passes the frontend build check
(`frontend-build-check.yaml`) in the branch, and then fails the cluster
run (`k3d-ci.yaml`) in `main` because the frontend build check installs
all dependencies, whereas the cluster run uses the frontend Dockerfile,
which skips everything but prod dependencies.

## Changes

This runs an additional step in the frontend build check, after running
unit tests and the l10n build but before doing the build, that re-runs
`yarn` with the same arguments as are in the frontend Dockerfile,
installing just prod dependencies.

This results in slightly longer frontend build check runtimes, but
should save us some wasted time fixing broken `main`.
2024-01-10 11:46:17 -08:00
Ilya Kreymer
a6936299d3 version: bump to 1.9.0-beta.0 2023-12-20 00:08:16 -08:00
sua yoo
dbd48cf8e3
Improvements to collection creation and editing flow (#1424)
Resolves https://github.com/webrecorder/browsertrix-cloud/issues/1333

- Moves "Select Crawls" / "Select Uploads" steps into a single "Select
Archived Items" dialog
- Refactors new collection metadata dialog to accept editing existing
collection
- Prevents RWP component from rendering if there are no archived items
(@Shrinks99 made a comment about this figma, but this prevents
unnecessary requests when there isn't an archive to replay)
- Shows collection description at bottom of detail page at all times
(@Shrinks99 seems useful to see even on archived items view?)
- Switches collection detail primary action to "Add Archived Items" if
none are included (cc @Shrinks99)
- Displays friendlier "name taken" error
- Removes unused Collection edit route
- Upgrades markdown dependencies for fixes/improvements to description
editing

---------
Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
2023-12-19 18:12:43 -08:00
Tessa Walsh
4fe014067e
Set runNow to false when editing existing workflows (#1458)
Fixes #1339
2023-12-18 14:23:04 -05:00
Emma Segal-Grossman
73e20269ef
Org settings layout fix + misc styling & consistency improvements (#1427)
## General changes

- Added `postcss-lit`, which allows us to use tailwind in lit elements
with shadow DOMs
- Added `// postcss-lit-disable-next-line` comments to most `` css`...`
`` tagged templates so as not to change existing CSS in components
- Added `TailwindElement`, which uses a single shared `CSSStyleSheet`
across all instances to be able to access Tailwind without requiring a
full copy of (compiled) Tailwind for every instance of a component that
extends it
- Added a new `<btrix-copy-field>` element, replacing the existing copy
elements

## Org settings page

- Stopped content from overflowing at medium widths
- Made spacing consistent at both smaller and wider widths
- Used readonly/monospace styling for copyable org id field
- Updated tab shadows to be slightly blue, consistent with the tab
background (also did this in other places tabs show up)

Before | After
-|-
![dev browsertrix
cloud_orgs_default-org_settings](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/9bcacdcc-259b-4a01-bac5-8913518776f0)
|
![localhost_9870_orgs_default-org_workflows_crawls](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/53936d4d-e5cd-4f37-ad06-b3b5041381df)
![dev browsertrix cloud_orgs_default-org_settings
(3)](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/602dd8d6-3012-4a0e-a638-a5192c9601ec)
| ![localhost_9870_orgs_default-org_workflows_crawls
(3)](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/74c93312-ad26-48d8-a87e-3da9a851693b)

## Misc fixes

- Used consistent single-line readonly/monospace styling for copyable
url field

Before | After
-|-
![dev browsertrix cloud_orgs_default-org_settings
(1)](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/e361feeb-3ea0-4f56-9e38-12ef6a644d58)
| ![localhost_9870_orgs_default-org_workflows_crawls
(1)](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/0145b1ad-8f45-4486-893e-8f638ac9add6)

- Removed inconsistent angled bottom borders from crawl workflow list
header

Before | After
-|-
![dev browsertrix cloud_orgs_default-org_settings
(2)](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/4aa20359-3ecf-4441-83c0-ed36a951ed3b)
| ![localhost_9870_orgs_default-org_workflows_crawls
(2)](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/8c771464-3a70-47e7-8475-fa82d4d030a9)

- Changes _all_ list page primary action buttons to use
`variant="primary"`

<img width="190" alt="Screenshot 2023-12-08 at 11 23 49 AM"
src="https://github.com/webrecorder/browsertrix-cloud/assets/5672810/2b007f5e-e675-40b2-86a7-f0bf8ef83b81">
<img width="240" alt="Screenshot 2023-12-08 at 11 23 43 AM"
src="https://github.com/webrecorder/browsertrix-cloud/assets/5672810/621b340e-2051-4ab0-8f42-8f0a51d8d3a5">

---------

Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
Co-authored-by: sua yoo <sua@webrecorder.org>
Co-authored-by: sua yoo <sua@suayoo.com>
2023-12-13 17:29:35 -05:00
sua yoo
2bb21c615d
Improve frontend event system (#1450)
- Adds notify, navigate, and log in events to global event map, handle
in `btrix-app`
- Adds console debugs, which are stripped in prod
- Replaces TODO redundant `navTo`s with controller implementation
- Refactors rest of `LitElement` helpers into arrow functions
2023-12-13 14:11:15 -08:00
Emma Segal-Grossman
647562be73
Use execution duration formatter in table view (#1449)
More-or-less cherry-picked from #1433 

## Changes
- Updated the data table to use `formatExecutionSeconds` rather than
`formatSeconds`
- Fixed an issue in `formatExecutionSeconds` where the time in minutes
would sometimes be displayed twice when `options.displaySeconds` was
false or unset

## Testing
Tested locally with orgs with and without execution limits of various
kinds set
2023-12-13 15:43:28 -05:00
sua yoo
603ace0740
Fix redirect to login page (#1445)
Fixes https://github.com/webrecorder/browsertrix-cloud/issues/1436, regression introduced in
https://github.com/webrecorder/browsertrix-cloud/pull/1381
2023-12-13 09:53:29 -08:00
Ilya Kreymer
d74d9ac09d
Recreate configmaps if missing (#1444)
If configmap is missing (eg. was accidentally deleted from k8s) recreate
the configmap when updating the crawl workflow or running a crawl.
Previously, this would result in an error, but now the configmap should
be correctly recreated.
2023-12-12 17:48:27 -05:00
sua yoo
3251b06e06
Fix fetch helper (#1442)
Fixes https://github.com/webrecorder/browsertrix-cloud/issues/1441,
regression introduced in
https://github.com/webrecorder/browsertrix-cloud/pull/1423

### Manual testing

1. Log in and go to "Archived Items"
2. Click a crawl. Verify that "Sorry, couldn't retrieve crawl logs"
notification doesn't show and logs fetch as expected.

### Follow-ups

Consistency pass on rest of `LitElement` helpers here:
https://github.com/webrecorder/browsertrix-cloud/pull/1443
2023-12-12 15:11:29 -05:00
Emma Segal-Grossman
a5dd35bd6e
Only load webpack-bundle-analyzer if BUNDLE_ANALYZER env var is present (#1446)
Fixes build failing in main

Tested with a local build (`./scripts/build-frontend.sh`)
2023-12-12 14:37:50 -05:00
sua yoo
7e4650ed61
Fix runtime error on log out (#1439)
Fixes https://github.com/webrecorder/browsertrix-cloud/issues/1438
2023-12-11 18:37:50 -08:00
Emma Segal-Grossman
bd59c12b83
Add bundle analyzer script (#1437)
Adds
[webpack-bundle-analyzer](https://www.npmjs.com/package/webpack-bundle-analyzer)
and a `build:analyze` npm script to run it.

Eventually it'd be nice to track metrics over time, but this is a good
start.
2023-12-11 19:21:56 -05:00
Emma Segal-Grossman
512698d747
Fix attribute casing & lit-analyzer issues (#1429)
## Changes
- Reverts changes introduced in #1407 that incorrectly changed attribute
casing
- Patches `@shoelace-style/shoelace` using
[`patch-package`](https://www.npmjs.com/package/patch-package) to add
JSDoc comments to component typedefs so that `lit-analyzer` can properly
pick up attributes
- Adds component typedef for `<replay-web-page>` component

## Testing
Tested by hand, it looks like missing help text/date formatting
changes/etc are back!

Before | After
-|-
![dev browsertrix
cloud_orgs_default-org_browser-profiles_profile_dea43f41-8777-4a42-b2ad-b8d43f6599b8](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/1c6be749-ee8f-4b07-84c7-b05c5df376a7)
|
![localhost_9870_orgs_default-org_browser-profiles_profile_dea43f41-8777-4a42-b2ad-b8d43f6599b8](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/4a305d3f-7947-4e13-b379-a82dc01620ea)
![dev browsertrix
cloud_orgs_default-org_browser-profiles_profile_dea43f41-8777-4a42-b2ad-b8d43f6599b8
(2)](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/a5e6bba6-ce03-4622-8f39-194ce08481b7)
|
![localhost_9870_orgs_default-org_browser-profiles_profile_dea43f41-8777-4a42-b2ad-b8d43f6599b8
(2)](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/33f076d8-aa20-4d25-9d1f-e6927d32819d)
![dev browsertrix
cloud_orgs_default-org_browser-profiles_profile_dea43f41-8777-4a42-b2ad-b8d43f6599b8
(1)](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/34761f6b-32a9-4eb5-a129-0df67bb90f65)
|
![localhost_9870_orgs_default-org_browser-profiles_profile_dea43f41-8777-4a42-b2ad-b8d43f6599b8
(1)](https://github.com/webrecorder/browsertrix-cloud/assets/5727389/d8144b10-fc9b-49a4-9641-604ad8fa4e5a)

---------

Co-authored-by: Ilya Kreymer <ikreymer@users.noreply.github.com>
2023-12-11 12:34:03 -05:00
Ilya Kreymer
d902cf5338 version: bump to 1.8.2 2023-12-07 13:34:37 -08:00
Tessa Walsh
a422aa7538
Fix dashboard usage history off-by-one labels (#1431)
Fixes #1430 

Uses a date squarely in the middle of the month to avoid timezone
differences from displaying the previous month's name for monthly usage
and execution time data
2023-12-07 13:16:58 -08:00
sua yoo
8d6375c654
Fix UI not updating after quotas reached status changes (#1425)
Fixes #1426 

- Update expected org field for execMinutesQuotaReached
- Move event handlers from child components to org index connectedCallback
- Add composed to events
- Improve typing



Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
2023-12-07 14:42:20 -05:00
Tessa Walsh
be41c48c27
Add extra and gifted execution minutes (#1361)
Fixes #1358 

- Adds `extraExecMinutes` and `giftedExecMinutes` org quotas, which are
not reset monthly but are updateable amounts that carry across months
- Adds `quotaUpdate` field to `Organization` to track when quotas were
updated with timestamp
- Adds `extraExecMinutesAvailable` and `giftedExecMinutesAvailable`
fields to `Organization` to help with tracking available time left
(includes tested migration to initialize these to 0)
- Modifies org backend to track time across multiple categories, using
monthlyExecSeconds, then giftedExecSeconds, then extraExecSeconds.
All time is also written into crawlExecSeconds, which is now the monthly
total and also contains any overage time above the quotas
- Updates Dashboard crawling meter to include all types of execution
time if `extraExecMinutes` and/or `giftedExecMinutes` are set above 0
- Updates Dashboard Usage History table to include all types of
execution time (only displaying columns that have data)
- Adds backend nightly test to check handling of quotas and execution
time
- Includes migration to add new fields and copy crawlExecSeconds to
monthlyExecSeconds for previous months

Co-authored-by: emma <hi@emma.cafe>
2023-12-07 14:34:37 -05:00
sua yoo
901f1435d7
Refactor LiteElement into reactive controllers (#1423)
- Copies navigation and notification utility methods into separate
controllers
- Adds deprecation notice to `LitElement` methods
- Default type import start to inline
2023-12-05 15:30:10 -08:00
Henry Wilkinson
a1e42b0cf3
Adds a link to the new ReplayWebpage replay issue form in GitHub (#1404)
- Adds a link to the new ReplayWeb.page issue type selection list where
users can file replay specific bugs.
- Updates security email URL now that we have one so this actually gets
shown!
2023-12-05 14:28:50 -08:00
Tessa Walsh
478b794f9b
Add API endpoint to retry all failed bg jobs (#1396)
Fixes #1395 

- Adds new `POST /orgs/<orgid>/jobs/retryFailed` API endpoint to retry all failed
background jobs for a specific org.
- Also adds `POST /orgs/all/jobs/retryFailed` for superadmin to retry all failed background jobs for all orgs
2023-12-05 13:00:45 -08:00
sua yoo
26636f5386
Refactor API fetch helper into controller (#1415)
### Context

Components currently can't access `LiteElement` utility methods without
being rendered into the light DOM. This is an initial step towards
breaking out parts of `LiteElement` into composable units. (see
https://github.com/webrecorder/browsertrix-cloud/issues/1380)

### Changes

Moves `apiFetch` from `LiteElement` into a reactive controller. New
components should use `APIController` directly instead of extending
`LiteElement`. We'll also work to move existing uses of `LiteElement`
off of it with time.

### Manual testing

No visible changes, skim through the app to verify that that backend API
fetches work as expected.
2023-11-30 15:00:43 -05:00
Emma Segal-Grossman
106fe5dd61
Organize components into folders by function (#1411) 2023-11-29 14:12:29 -05:00
sua yoo
4ee4f90ec7
chore: add btrix to spellcheck dictionary 2023-11-28 11:16:44 -08:00
Emma Segal-Grossman
f272c608b8
Fix failing builds on main (btrix-microk8s-test) (#1413)
Because tests aren't meant to be run on the CI builder, testing
dependencies aren't installed. `fork-ts-checker-webpack-plugin` still
was trying to type-check the test files though, and wasn't finding the
types for them. This changes the `fork-ts-checker-webpack-plugin` config
to ignore test files entirely.

Tested by manually in Docker with `scripts/build-frontend.sh`.

Thanks for your help @tw4l!

Fixes build regression introduced in
https://github.com/webrecorder/browsertrix-cloud/pull/1407
2023-11-28 11:33:19 -05:00
Tessa Walsh
3d93d0a0d0
Add API tests for browser profiles (#1392)
Fixes #1330
2023-11-28 10:40:58 -05:00
Emma Segal-Grossman
57cff1eac5
Move fork-ts-checker-webpack-plugin into dependencies (#1410)
Fixes builds failing because of a webpack dependency not being installed
when `--production` flag is used with yarn, e.g. here
https://github.com/webrecorder/browsertrix-cloud/pull/1396
2023-11-27 10:53:06 -05:00
sua yoo
ffc8b75ea8
Fix crawl list action menu positioning (#1399)
Refactors `btrix-crawl-list` dropdown action menu to use `sl-dropdown`
auto-positioning to fix menu clipping
2023-11-26 15:50:22 -08:00
Emma Segal-Grossman
b15c5ccddd
ESLint & Typescript fixes (#1407)
Closes #1405

- Properly uses `typescript-eslint`: we were missing the preset from it,
so some of the default `eslint` rules (that don't properly work with
typescript) were being applied and causing false positives
- I also moved the `eslint` config into its own file, and enabled
`typescript-eslint`'s type-awareness, so that we can enable more
type-aware rules in the future if we like
- Adds `ts-lit-plugin` to the typescript config, which _hopefully_ will
allow us to catch issues during build (in CI)
- It looks like `ts-lit-plugin` is sort of abandonware at the moment,
and unfortunately _doesn't_ actually work for this purpose right now,
but the lit team is working on a replacement here:
https://www.npmjs.com/package/@lit-labs/analyzer
- Adds `fork-ts-checker-webpack-plugin`, which allows the typescript
checking process to be run on a separate forked thread in Webpack, which
can help speed up builds & checking
- Enables incremental type checking for better speed
- Fixes a whole bunch of `eslint`-auto-fixable issues (unused imports
and variables, some type issues, etc)
- Fixes a bunch of `lit-analyzer` issues (mostly attribute naming, some
type issues as well)
- Fixes various other type issues:
- Improves type safety in a bunch of places, notably anywhere `apiFetch`
and `APIPaginatedList` are used
  - Removes some `any`s
2023-11-24 12:32:53 -05:00
sua yoo
006ce5a013
Prompt user to confirm workflow crawl deletion (#1401)
- Adds confirmation dialog for workflow crawls
- Changes archived item confirmation from default browser dialog to
shoelace dialog
- Increase dialog title size
- Out of scope: Localizes other workflow detail confirmation buttons
- Out of scope: Reword missed "Archive" reference in file uploader
2023-11-22 12:40:49 -08:00
Emma Segal-Grossman
d64def00c2
Move execution time formatting into its own util (#1386)
Refactors and rewrites the humanize time functions used on the
dashboard, and swaps out these new functions in a couple of places.

Examples of these functions' behaviours can be found in the tests for
them.

<img width="375" alt="Screenshot 2023-11-16 at 8 07 14 PM"
src="https://github.com/webrecorder/browsertrix-cloud/assets/5727389/775b3a49-1061-4002-8c34-961777423542">

<img width="267" alt="Screenshot 2023-11-16 at 8 07 45 PM"
src="https://github.com/webrecorder/browsertrix-cloud/assets/5727389/1d22aec0-4b88-4a9a-b1d7-f6612d287769">

<img width="224" alt="Screenshot 2023-11-16 at 8 21 13 PM"
src="https://github.com/webrecorder/browsertrix-cloud/assets/5727389/7d895938-ea02-4ffa-9f82-8526725f36c5">


Also fixes inconsistent tooltip text alignment on the dashboard :)
2023-11-21 16:51:08 -05:00
sua yoo
0638e5dad8
Fix org settings help and info text (#1402)
Resolves https://github.com/webrecorder/browsertrix-cloud/issues/1400

### Changes

- Adds `/orgs` to "Custom URL Identifier" help text
- Fixes color mismatch between info text
2023-11-21 09:35:07 -08:00
Emma Segal-Grossman
232a29f7a2
Merge pull request #1381 from webrecorder/1379-refactor-components-index-file
Refactor components index file, and add better vscode extensions and settings
2023-11-20 16:59:13 -05:00
emma
012ee3c930
add vscode config symlink in frontend dir 2023-11-20 16:56:48 -05:00
emma
5f3bc32154
merge vscode settings in repo root 2023-11-20 16:56:26 -05:00
sua yoo
c3edc253f8
enable strict mode 2023-11-20 13:33:32 -08:00
sua yoo
219f8b798d
add extension recomendations 2023-11-20 13:33:32 -08:00
emma
5fa2c39193
update remaining pages 2023-11-20 16:26:29 -05:00
sua yoo
812af7b615
consistent decorator order 2023-11-20 13:15:20 -08:00
sua yoo
35ddc4de27
update other half of components 2023-11-20 13:06:54 -08:00
Henry Wilkinson
f507f1d2ec
Fixes allowed actions for viewers and crawlers throughout the app (#1326)
Closes #1294

### Changes
- `crawl-list` component
- Adds a check if there are any items in the actions menu. If not, skip
rendering the actions menu.
- This allows us to give the component no actions! Currently required to
remove them for viewers!
- Collection Details
  - Hides "Remove from Collection" option for viewers
- Crawls List
- Removes the single "View Crawl Details" option from archived items for
viewers
- All the other actions were already set up correctly to be used by all
roles!
- Dashboard
  - Hides org settings gear icon button unless the user is an admin
  - Hides "Create New" dropdown for viewers
- Workflow Details
  - Hides workflow edit icon button for viewers
  - Hides the "Delete Crawl" option in archived items for viewers
  - Hides the "Run Crawl" option for viewers
- Workflow List
- Hides all edit-related options for viewers, the only option now is
copying tags
- Removes the deactivate / delete options (were only visible when
running a crawl) in the workflow list actions

---------
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
Co-authored-by: sua yoo <sua@suayoo.com>
2023-11-17 14:41:21 -08:00
Ilya Kreymer
1218d6e767 version: bump to 1.8.1 2023-11-17 14:39:52 -08:00
Ilya Kreymer
b6f8c968e9 version: bump to 1.8.0 2023-11-15 17:57:43 -08:00
Henry Wilkinson
ae8804d87f
Improves user documentation intro (#1376)
Closes #1369 

### Changes
- Adds improved getting started steps and intro contact information to
the User Guide homepage
- Adds a small section about the execution minutes graph for orgs with a
quota set
- Moves existing signup content to a dedicated signup page
- Changes admonitions from using em dashes to using colons.
- Em dashes are great and I love em.... But sometimes I love them a
little _too_ much and they were a bad fit here.
- Fixes user guide homepage link
- Fixes `ReplayWeb.page` and `ArchiveWeb.page` names
- Fixes broken links (would be good to have a CI system for this I
think)

---------
Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
2023-11-15 17:55:47 -08:00
emma
cfd38aa06b fix path for custom element import 2023-11-15 18:25:55 -05:00
emma
bc6f362861 update pages as well 2023-11-15 18:24:50 -05:00