* 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>
* feat: begin upgrading deps, still very buggy
* feat: progress
* feat: sort all type issues
* fix: sort type issues
* fix: import sonner styles
* fix: nuxt is the enemy
* fix: try sorting issue with workflows
* fix: update vitest config for dynamic import of path and defineConfig
* fix: add missing import
* fix: add time out to try and fix issues
* fix: add ui:ci:preview task for frontend build in CI mode
* fix: i was silly
* feat: add go:ci:with-frontend task for CI mode and remove ui:ci:preview from e2e workflow
* fix: update baseURL in Playwright config for local testing to use port 7745
* fix: update E2E_BASE_URL and remove wait for timeout in login test for smoother execution
* fix: change Content-Disposition to inline for proper document display in attachments
* feat: overhaul how dialog system works, add delete to image dialog and add button to open image dialog on edit page
* chore: remove unneeded console log
* fix: ensure cleanup of dialog callbacks on unmount in BarcodeModal, CreateModal, and ImageDialog components
- fix many missing translations
- properly reset QR scanner when reopening
- add error message on BarcodeModal when no item is found
- fix icon size in item CreateModal
- remove useless closeDialog
* add missing translations and translate page titles
* fix: actually use the declared localized variables
* lint and prettier fixes
* add missing translations for toasts and confirms
* use components for shift/enter keys, add pluralization for photos, and fix primary photo conditional
* remove prop defaults since we're computing these anyways
* Create a rotate 90 degrees clockwise button for each image
* Added more error handling and turned rotate function to async as recommended by coderabbitai
* Add a quantity field to the item create modal form.
* Fix prettier code format complaint.
* Update en.json allowing the label of the field to be translated.
* Including changes generated by swag and typescript-types tasks.
* Fixed tests, item duplication and lint errors.
* Fix linter issues again and an error introduced in 912e5b2
* Fixed a test that creates an item through the go:coverage task
* feat: sort themes and remove daisyui
* docs: update docs to reflect daisyui being removed
* feat: remove specific colours for better theme compatibility
* feat: begin switching sonner, currently this breaks all alerts
* feat: switch to using new sonner and fix class names
* feat: add Shortcut component for improved keyboard shortcuts display in default layout
* feat: rewrite quick menu modal in shadcn
* feat: update QuickMenu modal placeholders and localize no results message in default layout
* feat: begin switching modals in layout to use shadcn dialog, needs bug fixing
* feat: implement DialogProvider for consistent dialog management across components
* fix: types
* feat: begin adding shadcn label selector (wip)
* feat: shadcnify textarea
* feat: begin adding location selector
* feat: add hotkey support for opening create modals in dialog provider components
* fix: update click event on NuxtLink and reorder sidebar menu item IDs for consistency
* feat: unify shortcut text across create modals and sort issue with text centring
* feat: prevent dialog from opening when a dialog alert is open
* fix: prevent potential out of bounds error
* feat: enhance button group UI in create modals for better layout and introduce new item photo label in the form
* fix: search on label selector
* chore: lint
* fix: oops
* feat: make selector usable
* feat: add actual data to label selector
* feat: label selector kinda works
* fix: add legacy selector for edit page
* fix: enable camera capture in image upload for CreateModal component
* fix: z levels for sidebar mobile
* fix: gap between inputs
* feat: update radix-vue, custom search function for location selector
* feat: add fuzzysort (can always remove it and go to lunr if we want to)
* feat: limit label name to 50 characters in create modal and selector, helps with issues with ui not working with larger labels, as it is only enforced on the frontend could be easily bypassed but thats a them problem
* feat: add colours to toast
* chore: lint
* feat: abstract the dialog for creation modals
* feat: add drawer component and responsive dialog for create modals
* feat: enhance photo preview in CreateModal
* fix: remember state of sidebar
* feat: add ui functionality for changing primary image
* feat: use button for file upload
* style: lint
* fix: dont clone asset id
* fix: using create and add label breaks selector
* chore: oops remove logging
* chore: lint
* fix: cut length of label dramatically to ensure maximal compatibility, not sure if too much
* fix: more limiting of label length
* feat: update reka-ui (prev radix-vue)
* chore: cleanup dialog provider and siebar provider a bit
* fix: improve accessibility
* fix: docs for shadcn error
* fix: hack to prevent issues with lots of toasts in quick succession
* feat: cleanup toast file and lint
* feat: improvements to dialog scroll and disable the ability to set default photo for now
* feat: add tooltips for photo buttons
* chore: substring to length check
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add a delete icon to every photo added in the create item modal form.
* Add a delete icon to every photo added in the create item modal form.
* Corrected margin of filename.
* Format the layout of the delete button using daisyUI indicator component CSS classes.
* Moved PhotoPreview interface to the local component file, it should not go in data-contracts.ts, this file is generated based on the contents of swagger.json, that is generated based on the contents of the backend, the type definition if it needs to be shared should go inside non-generated.ts
* chore: get front end tests passing
* chore: add @vue/runtime-core to fix types for $t
* chore: sort lockfile
* Discard changes to frontend/pnpm-lock.yaml
* chore: sort lockfile
* chore: fix some type errors
* chore: switch from nuxi typecheck to vue-tsc to force a known good version
* chore: linting
* chore: update pnpm version in frontend test
* feat: add proper pagination type (need to sort why it still doesn't work)
* chore: format imports and initialize totalPrice in label page to null when no label is present
* chore: update pnpm to v9.12.2, merge ItemSummaryPaginationResult with PaginationResult, and handle error in label generator more gracefully
* chore: lint
---------
Co-authored-by: Matt Kilgore <matthew@kilgore.dev>
* added the ability to add a photo in the item creation modal
* fixed problem with create button being hidden on tiny screens
* fix: ui, translations
---------
Co-authored-by: Matt Kilgore <matthew@kilgore.dev>
* rough implementation of WS based event system for server side notifications of mutation
* fix test construction
* fix deadlock on event bus
* disable linter error
* add item mutation events
* remove old event bus code
* refactor event system to use composables
* refresh items table when new item is added
* fix create form errors
* cleanup unnecessary calls
* fix importer erorrs + limit fn calls on import
Former-commit-id: 2cbcc8bb1d
* new PR tasks
* add homebox to know words
* formatting
* bump deps
* generate db models
* ts errors
* drop id
* fix accessor
* drop unused time field
* change CI
* add expected error
* add type check
* resolve serveral type errors
* hoise in CI
* fix generated types
* fix tailwind auto-complete
* force lowercase buttons
* add title and change style for items page
* add copy button support for item details
* empty state for log
* fix duplicate padding
* add option for create without closing the current dialog.
* hide purchase price is not set
* invert toggle for edit mode
* update styles on item cards
* add edit support for maintenance logs