Commit Graph

173 Commits

Author SHA1 Message Date
Matthew Kilgore
8f03a8e2e9 Remove old ent generated things that should have already been removed. 2025-12-13 21:47:10 -05:00
Matthew Kilgore
e198c2aba2 Actually finish merge things 2025-12-13 21:36:53 -05:00
Matthew Kilgore
798426bebf Finish merge stuff with main 2025-12-13 21:23:45 -05:00
Matthew Kilgore
44f488db77 Merge remote-tracking branch 'origin/main' into mk/merge-entities
# Conflicts:
#	backend/app/api/static/docs/docs.go
#	backend/app/api/static/docs/openapi-3.json
#	backend/app/api/static/docs/openapi-3.yaml
#	backend/app/api/static/docs/swagger.json
#	backend/app/api/static/docs/swagger.yaml
#	backend/go.mod
#	backend/go.sum
#	backend/internal/data/ent/attachment.go
#	backend/internal/data/ent/attachment_create.go
#	backend/internal/data/ent/attachment_query.go
#	backend/internal/data/ent/attachment_update.go
#	backend/internal/data/ent/client.go
#	backend/internal/data/ent/ent.go
#	backend/internal/data/ent/entityfield.go
#	backend/internal/data/ent/group.go
#	backend/internal/data/ent/group/group.go
#	backend/internal/data/ent/group/where.go
#	backend/internal/data/ent/group_create.go
#	backend/internal/data/ent/group_query.go
#	backend/internal/data/ent/group_update.go
#	backend/internal/data/ent/has_id.go
#	backend/internal/data/ent/hook/hook.go
#	backend/internal/data/ent/item.go
#	backend/internal/data/ent/item_create.go
#	backend/internal/data/ent/item_delete.go
#	backend/internal/data/ent/item_query.go
#	backend/internal/data/ent/item_update.go
#	backend/internal/data/ent/itemfield_create.go
#	backend/internal/data/ent/itemfield_delete.go
#	backend/internal/data/ent/itemfield_query.go
#	backend/internal/data/ent/itemfield_update.go
#	backend/internal/data/ent/label.go
#	backend/internal/data/ent/label_create.go
#	backend/internal/data/ent/label_query.go
#	backend/internal/data/ent/label_update.go
#	backend/internal/data/ent/location.go
#	backend/internal/data/ent/location_create.go
#	backend/internal/data/ent/location_delete.go
#	backend/internal/data/ent/location_query.go
#	backend/internal/data/ent/location_update.go
#	backend/internal/data/ent/maintenanceentry.go
#	backend/internal/data/ent/maintenanceentry_create.go
#	backend/internal/data/ent/maintenanceentry_query.go
#	backend/internal/data/ent/maintenanceentry_update.go
#	backend/internal/data/ent/migrate/schema.go
#	backend/internal/data/ent/mutation.go
#	backend/internal/data/ent/predicate/predicate.go
#	backend/internal/data/ent/runtime.go
#	backend/internal/data/ent/schema/group.go
#	backend/internal/data/ent/tx.go
#	backend/internal/data/ent/user.go
#	backend/internal/data/ent/user_create.go
#	backend/internal/data/ent/user_update.go
#	backend/internal/data/repo/repo_entity_attachments.go
#	backend/internal/data/repo/repo_items.go
#	backend/internal/data/repo/repo_items_search_test.go
#	backend/internal/data/repo/repos_all.go
#	docs/en/api/openapi-3.0.json
#	docs/en/api/openapi-3.0.yaml
#	docs/en/api/swagger-2.0.json
#	docs/en/api/swagger-2.0.yaml
#	frontend/lib/api/types/data-contracts.ts
2025-12-13 21:19:43 -05:00
Matt
4334f926c0 Fix postgres nullable password migration to be at end 2025-12-09 14:44:53 -05:00
Matthew Kilgore
55e247ac71 Fix missing postgres OIDC migration 2025-12-08 20:10:36 -05:00
Logan Miller
cc66330a74 feat: Add item templates feature (#435) (#1099)
* feat: Add item templates feature (#435)

   Add ability to create and manage item templates for quick item creation.
   Templates store default values and custom fields that can be applied
   when creating new items.

   Backend changes:
   - New ItemTemplate and TemplateField Ent schemas
   - Template CRUD API endpoints
   - Create item from template endpoint

   Frontend changes:
   - Templates management page with create/edit/delete
   - Template selector in item creation modal
   - 'Use as Template' action on item detail page
   - Templates link in navigation menu

* refactor: Improve template item creation with a single query

- Add `CreateFromTemplate` method to ItemsRepository that creates items with all template data (including custom fields) in a single atomic transaction, replacing the previous two-phase create-then-update pattern
- Fix `GetOne` to require group ID parameter so templates can only be accessed by users in the owning group (security fix)
- Simplify `HandleItemTemplatesCreateItem` handler using the new transactional method

* Refactor item template types and formatting

Updated type annotations in CreateModal.vue to use specific ItemTemplate types instead of 'any'. Improved code formatting for template fields and manufacturer display. Also refactored warranty field logic in item details page for better readability. This resolves the linter issues as well that the bot in github keeps nagging at.

* Add 'id' property to template fields

Introduces an 'id' property to each field object in CreateModal.vue and item details page to support unique identification of fields. This change prepares the codebase for future enhancements that may require field-level identification.

* Removed redundant SQL migrations.

Removed redundant SQL migrations per @tankerkiller125's findings.

* Updates to PR #1099.

Regarding pull #1099. Fixed an issue causing some conflict with GUIDs and old rows in the migration files.

* Add new fields and location edge to ItemTemplate

Addresses recommendations from @tonyaellie.

* Relocated add template button
* Added more default fields to the template
* Added translation of all strings (think so?)
* Make oval buttons round
* Added duplicate button to the template (this required a rewrite of the migration files, I made sure only 1 exists per DB type)
* Added a Save as template button to a item detail view (this creates a template with all the current data of that item)
* Changed all occurrences of space to gap and flex where applicable.
* Made template selection persistent after item created.
* Collapsible template info on creation view.

* Updates to translation and fix for labels/locations

I also added a test in here because I keep missing small function tests. That should prevent that from happening again.

* Linted

* Bring up to date with main, fix some lint/type check issues

* In theory fix playwright tests

* Fix defaults being unable to be nullable/empty (and thus limiting flexibility)

* Last few fixes I think

* Forgot to fix the golang tests

---------

Co-authored-by: Matthew Kilgore <matthew@kilgore.dev>
2025-12-06 16:21:43 -05:00
Matthew Kilgore
848b444aef Fix postgres migration, and attempt new provenance publishing 2025-12-06 14:22:46 -05:00
Jeff Rescignano
f36756d98e Add support for SSO / OpenID Connect (OIDC) (#996)
* ent re-generation

* add oidc integration

* document oidc integration

* go fmt

* address backend linter findings

* run prettier on index.vue

* State cookie domain can mismatch when Hostname override is used (breaks CSRF check). Add SameSite.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Delete state cookie with matching domain and MaxAge; add SameSite.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Fix endpoint path in comments and error to include /api/v1.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Also use request context when verifying the ID token.

* Do not return raw auth errors to clients (user-enumeration risk).

* consistently set cookie the same way across function

* remove baseURL after declaration

* only enable OIDC routes if OIDC is enabled

* swagger doc for failure

* Only block when provider=local; move the check after parsing provider

* fix extended session comment

* reduce pii logging

* futher reduce pii logging

* remove unused DiscoveryDocument

* remove unused offline_access from default oidc scopes

* remove offline access from AuthCodeURL

* support host from X-Forwarded-Host

* set sane default claim names if unset

* error strings should not be capitalized

* Revert "run prettier on index.vue"

This reverts commit aa22330a23.

* Add timeout to provider discovery

* Split scopes robustly

* refactor hostname calculation

* address frontend prettier findings

* add property oidc on type APISummary

* LoginOIDC: Normalize inputs, only create if not found

* add oidc email verification

* oidc handleCallback: clear state cookie before each return

* add support for oidc nonce parameter

* Harden first-login race: handle concurrent creates gracefully and fix log key.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* support email verified claim as bool or string

* fail fast on empty email

* PKCE verifier

* fix: add timing delay to attachment test to resolve CI race condition

The attachment test was failing intermittently in CI due to a race condition
between attachment creation and retrieval. Adding a small 100ms delay after
attachment creation ensures the file system and database operations complete
before the test attempts to verify the attachment exists.

* Revert "fix: add timing delay to attachment test to resolve CI race condition"

This reverts commit 4aa8b2a0d829753e8d2dd1ba76f4b1e04e28c45e.

* oidc error state, use ref

* rename oidc.force to oidc.authRedirect

* remove hardcoded oidc error timeout

* feat: sub/iss based identity matching and userinfo endpoint collection

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Matthew Kilgore <matthew@kilgore.dev>
2025-12-06 10:16:05 -05:00
Tonya
0801df9961 fix: use tx for duplicate (#1059) 2025-10-21 20:58:06 +01:00
Copilot
397a1c6f3e Fix: Return error to UI when attachment upload fails due to storage misconfiguration (#1045)
* Initial plan

* Fix attachment upload error handling to return errors to UI

Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com>

* Final verification: All tests pass and code builds successfully

Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com>
2025-10-11 08:55:15 -04:00
Copilot
05a392346f Fix item deletion to properly clean up attachment files from storage (#1046)
* Initial plan

* Fix item deletion to properly clean up attachment files

Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com>
2025-10-11 08:55:02 -04:00
Matthew Kilgore
b8cca4b383 Merge branch 'main' into mk/merge-entities
# Conflicts:
#	backend/app/api/static/docs/docs.go
#	backend/app/api/static/docs/swagger.json
#	backend/internal/data/repo/repo_items.go
#	docs/en/api/swagger-2.0.json
#	frontend/lib/api/types/data-contracts.ts
2025-10-05 18:58:28 -04:00
Matthew Kilgore
9c121f235c Start putting things together for the new entities repository. 2025-10-05 18:52:21 -04:00
Tonya
6cd9e2779f Use Tanstack table for Selectable Table, quick actions (#998)
* feat: implement example of data table

* feat: load item data into table

* chore: begin switching dialogs

* feat: implement old dialog for controlling headers and page size

* feat: get table into relatively usable state

* feat: enhance dropdown actions for multi-selection and CSV download

* feat: enhance table cell and dropdown button styles for better usability

* feat: json download for table

* feat: add expanded row component for item details in data table

* chore: add translation support

* feat: restore table on home page

* fix: oops need ids

* feat: move card view to use tanstack to allow for pagination

* feat: switch the items search to use ItemViewSelectable

* fix: update pagination handling and improve button click logic

* feat: improve selectable table

* feat: add indeterminate to checkbox

* feat: overhaul maintenance dialog to use new system and add maintenance options to table

* feat: add label ids and location id to item patch api

* feat: change location and labels in table view

* feat: add quick actions preference and enable toggle in table settings

* fix: lint

* fix: remove sized 1 pages

* fix: attempt to fix type error

* fix: various issues

* fix: remove

* fix: refactor item fetching logic to use useAsyncData for improved reactivity and improve use confirm

* fix: sort backend issues

* fix: enhance CSV export functionality by escaping fields to prevent formula injection

* fix: put aria sort on th not button

* chore: update api types
2025-09-24 02:37:38 +01:00
Matthew Kilgore
ab1fd674ee Add entitytypes delete method 2025-09-11 22:18:15 -04:00
Matthew Kilgore
c0cb5794f3 Lint the things 2025-09-10 22:12:52 -04:00
Matthew Kilgore
3f2ae368ba API stuff for entity types 2025-09-10 21:34:39 -04:00
Matthew Kilgore
5456390b63 What should be a working Postgres migration 2025-09-10 20:28:02 -04:00
Matthew Kilgore
fa9b7af117 Working locations/items tree 2025-09-06 17:37:30 -04:00
Matthew Kilgore
e7f5866465 Further progress on sqlite 2025-09-05 22:44:40 -04:00
Matthew Kilgore
8f4ed9afd2 Slow progress, but we're getting there. 2025-09-05 21:18:18 -04:00
Matthew Kilgore
234302e50b Merge remote-tracking branch 'origin/main' into mk/merge-entities 2025-09-05 20:18:26 -04:00
confiks
0408b1c03b Use CatmullRom instead of ApproxBiLinear for thumbnail generation (#964) 2025-09-05 11:19:46 -04:00
Copilot
a2e108eac4 Make attachment storage paths relative in database with cross-platform support (#967) 2025-09-05 11:12:51 -04:00
Matthew Kilgore
564bd8ca06 Get main into this PR.
Done on ✈️
2025-09-02 15:09:42 -04:00
Matthew Kilgore
e00cebb7fa Merge branch 'refs/heads/main' into mk/merge-entities
# Conflicts:
#	backend/app/api/static/docs/docs.go
#	backend/app/api/static/docs/swagger.json
#	backend/go.mod
#	backend/go.sum
#	backend/internal/data/ent/entity_predicates_test.go
#	backend/internal/data/repo/repo_items.go
#	docs/en/api/openapi-2.0.json
2025-09-02 14:54:20 -04:00
Michael Manganiello
377c6c6e0d fix: Remove log.Fatal in favor of returning errors (#953)
* fix: Remove log.Fatal in favor of returning errors

This change is useful for including error tracking, which needs the
application to not terminate immediately, and instead give the tracer
time to capture and flush errors.

* Fix CodeRabbit issues

---------

Co-authored-by: Matthew Kilgore <matthew@kilgore.dev>
2025-08-23 13:09:40 -04:00
Tonya
788d0b1c7e feat: improved duplicate (#927)
* feat: improved duplicate

* feat: enhance item duplication process with transaction handling and error logging for attachments and fields

* feat: add error logging during transaction rollback in item duplication process for better debugging

* feat: don't try and rollback is the commit succeeded

* feat: add customizable duplication options for items, including prefix and field copying settings in API and UI

* fix: simplify duplication checks for custom fields, attachments, and maintenance entries in ItemsRepository duplication method

* refactor: import DuplicateSettings type from composables and sort import issues
2025-08-23 16:17:15 +01:00
Michael Manganiello
8af1e8fcba fix: Allow up to 1000 characters for label description (#948)
The database schema already supports 1,000 characters for label
description, so this seems just like an oversight.
2025-08-20 15:29:49 -04:00
Matt
d41f313cff Fix Windows Paths (#917)
* In theory this should fix the issue with Windows paths

* Fix Windows path handling in file storage connections for non-default
2025-08-16 17:08:24 -04:00
Matias Godoy
362c0bb3e6 Fix accent-insensitive search for Postgres databases (#932) 2025-08-04 20:35:22 -04:00
Matthew Kilgore
b107ab026a Refactor entity attachment handling and update API routes for entities 2025-07-27 18:20:34 -04:00
Matthew Kilgore
77b14f3a55 More merge fixing 2025-07-27 17:42:58 -04:00
Matthew Kilgore
64907bbb3a Cleanup merge 2025-07-27 17:37:56 -04:00
Matthew Kilgore
de1491133b Merge branch 'main' into mk/merge-entities
# Conflicts:
#	.github/workflows/binaries-publish.yaml
#	.github/workflows/e2e-partial.yaml
#	.github/workflows/partial-backend.yaml
#	.github/workflows/partial-frontend.yaml
#	backend/app/api/handlers/v1/v1_ctrl_items.go
#	backend/go.mod
#	backend/go.sum
#	backend/internal/data/ent/attachment.go
#	backend/internal/data/ent/attachment/attachment.go
#	backend/internal/data/ent/attachment/where.go
#	backend/internal/data/ent/attachment_create.go
#	backend/internal/data/ent/attachment_query.go
#	backend/internal/data/ent/attachment_update.go
#	backend/internal/data/ent/migrate/schema.go
#	backend/internal/data/ent/mutation.go
#	backend/internal/data/repo/repo_item_attachments.go
#	backend/internal/data/repo/repo_items.go
2025-07-27 17:31:33 -04:00
Crumb Owl
a3c13a8a74 ProductBarcode: return an array of BarcodeProduct instead of one 2025-07-19 23:06:38 +02:00
Matias Godoy
bcd77ee796 Make search accent-insensitive (#887)
* Make search accent-insensitive

* Efficiendy improvements and small fixes

* Fix tests to improve coverage

* Fix SQL compatibility issues
2025-07-12 16:16:55 -04:00
Matt
23cecfb2a5 Refactor main file, add support for postgres certificate authentication (#897)
* Refactor main file, add support for postgres certificate authentication

* Fix potential issues.

* Remove legacy linting ignore comment

* Minor cleanup, documentation update
2025-07-12 16:11:50 -04:00
Copilot
72033341b4 Fix photo display issue when adding additional attachments to items (#895)
* Initial plan

* Fix attachment display issue - prevent photo primary status loss when updating non-photo attachments

Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com>
2025-07-12 13:36:21 -04:00
mcarbonne
ce1e58828a Add migration for old sqlite timestamps (#869)
* add migration for old sqlite timestamps

* format python file + add support for negative timezones
2025-07-06 21:42:19 -04:00
Matt
be1f3c0ad3 Use aspect ratio when making thumbnails and fix rotation (#857) 2025-07-04 11:44:08 -04:00
Matthew Kilgore
ccdab8bac1 Fix attachments get method 2025-07-01 19:03:24 -04:00
Matt
e159dd8a0b Merge commit from fork 2025-07-01 09:56:34 -04:00
Matt
f30c9d9156 fix: foreign key issue with thumbnails (#824) 2025-06-29 12:24:22 -04:00
Matt
4861a8537f More image type support for thumbnails (#814) 2025-06-26 10:19:34 -04:00
Tonya
ef39549c37 Custom Colored Labels (#801)
* feat: custom coloured labels

* chore: lint

* feat: add ColorSelector component for improved color selection in labels and integrate it into CreateModal and Selector components

* style: lint

* fix: update ColorSelector and Selector components to use empty string instead of null for default color values for types
2025-06-23 15:52:32 +01:00
Matt
989100d299 Thumbnails (#797)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: tonya <tonya@tokia.dev>
2025-06-22 21:32:48 -04:00
Matt
e1b232e0d1 Abstract Attachment Storage (#777)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-06-19 10:26:12 -04:00
LunarEclipse363
04df4d8a08 Fixed labelmaker pagination on PostgreSQL (#779)
Fixes #753
2025-06-09 15:23:56 -04:00