diff --git a/CHANGELOG.md b/CHANGELOG.md index c9845621ee..3ab2ce5752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking Changes +- [#11971](https://github.com/inventree/InvenTree/pull/11971) is a major refactor of how notes are handled. Notes are now stored in a separate database table (in line with how attachments are handled), and each model instance can have multiple notes associated with it. The `notes` field has been removed from the individual models (and their associated API endpoints), and notes are now accessed via the new `/api/note/` endpoint. Existing notes data (and any embedded images) are automatically migrated to the new notes table, with the markdown content converted to HTML. Any external client applications which read or write the `notes` field via the API will need to be updated to use the new endpoint. - [#12507](https://github.com/inventree/InvenTree/pull/12507) calling an invalid or repeated state transition now raises a ValidationError. Plugins implementing state transitions should evaluate the PR and adapt their usage of transitions to gain the new safeguards. - [#12672](https://github.com/inventree/InvenTree/pull/12672) renames the newly added `tags` filter from 1.4.0 (https://github.com/inventree/InvenTree/pull/12077) to `tag_name` to remove a nameclash. diff --git a/docs/docs/assets/images/build/build_notes.png b/docs/docs/assets/images/build/build_notes.png deleted file mode 100644 index 31894bd427..0000000000 Binary files a/docs/docs/assets/images/build/build_notes.png and /dev/null differ diff --git a/docs/docs/assets/images/concepts/notes-tab.png b/docs/docs/assets/images/concepts/notes-tab.png new file mode 100644 index 0000000000..66dc0d70cb Binary files /dev/null and b/docs/docs/assets/images/concepts/notes-tab.png differ diff --git a/docs/docs/concepts/notes.md b/docs/docs/concepts/notes.md new file mode 100644 index 0000000000..f7b56a9d89 --- /dev/null +++ b/docs/docs/concepts/notes.md @@ -0,0 +1,147 @@ +--- +title: Notes +--- + +## Notes + +*Notes* allow free-form rich-text content to be written and stored against a specific object within InvenTree. Notes can be used to record observations, instructions, historical context, or any other information associated with a model instance. + +!!! note "Business Logic" + Notes are not to be used for any core business logic within InvenTree. They are intended to provide supplementary documentation and context for objects, which can be useful for reference, communication, or reporting purposes. Plugins should not use them for storage and opt for object metadata or custom models instead. + +Notes can be associated with various InvenTree models, and each model can have multiple notes associated with it. The user interface provides a dedicated "Notes" tab on the detail page of any model that supports notes, allowing users to easily view and manage notes for that object. + +### Notes Tab + +Any model which supports notes will have a "Notes" tab on its detail page. This tab displays the content of the currently selected note, along with a sidebar listing all notes for that object by title: + +{{ image("concepts/notes-tab.png", "Notes Tab Example") }} + +## Note Fields + +Each note has the following attributes: + +| Field | Description | +| --- | --- | +| Title | A short title for the note (*required*) | +| Description | An optional brief description of the note's purpose | +| Content | The rich-text body of the note | +| Primary | Marks this note as the default note for the object | + +## Primary Note + +When a model has multiple notes, one may be designated as the *primary* note. The primary note is indicated by a {{ icon("star") }} icon in the note sidebar. + +- When the first note is created for a model instance, it is automatically set as the primary note. +- Only one note per model instance can be marked as primary at any time. +- The primary note is opened by default when navigating to the Notes tab. + +## Rich Text Editing + +Note content is edited using a rich-text (WYSIWYG) editor. The following formatting options are available: + +- **Text formatting**: Bold, italic, underline, strikethrough, inline code, code blocks +- **Headings**: H1 through H4 +- **Structure**: Blockquotes, horizontal rules +- **Lists**: Bullet lists and ordered lists +- **Links**: Insert and remove hyperlinks +- **Tables**: Insert tables; add/remove rows and columns; toggle header rows +- **Images**: Embed images uploaded directly into the note + +### Inserting Images + +Images can be embedded in note content in the following ways: + +- Click the {{ icon("photo") }} button in the editor toolbar to select a file from your device +- Paste an image directly from the clipboard +- Drag and drop an image file into the editor + +Uploaded images are stored on the server and linked to the note. If a note is edited or deleted, any images that are no longer referenced by any note are automatically removed. + +## Adding a Note + +To add a note to an object: + +1. Navigate to the object's detail page +2. Click on the **Notes** tab +3. Click the **Add Note** button +4. Fill in the `Title` (required) and optional `Description` fields +5. Click **Submit** + +The new note will appear in the sidebar ready for editing. + +## Editing Note Content + +Note content is shown in read-only mode by default. To make changes: + +1. Click the {{ icon("pencil") }} icon in the note header to enter edit mode +2. Use the toolbar to format content, insert images, or add tables +3. Click the {{ icon("device-floppy") }} icon, or press **Ctrl+S** / **Cmd+S**, to save changes +4. Click the {{ icon("check") }} icon to exit edit mode once all changes are saved + +!!! warning "Unsaved Changes" + If you navigate away from the Notes panel or leave the page while in edit mode with unsaved changes, InvenTree will prompt you to confirm before proceeding. + +### Resetting Changes + +While in edit mode, clicking the {{ icon("reload") }} icon discards any unsaved changes and reloads the last saved version of the note. + +## Editing Note Properties + +To change a note's title or description, open the actions menu in the note header and select **Edit Note**. + +## Deleting a Note + +To delete a note, open the actions menu in the note header and select **Delete Note**. + +!!! danger "Permanent Action" + Deleting a note is permanent and cannot be undone. Any images embedded in the note that are not referenced elsewhere will also be removed. + +## Note Templates + +Note templates are pre-defined notes that can be used as a starting point when adding a new note to any model instance. They allow administrators to standardize common note structures and reduce repetitive data entry. + +### Creating Notes from Templates + +When adding a new note to an object, an optional **From Template** field is available. Selecting a template pre-fills the **Title**, **Description**, and **Content** fields with the template's content. These fields can then be edited before saving. + +To create a note from a template: + +1. Navigate to the object's detail page and open the **Notes** tab +2. Click the **Add Note** button +3. In the **From Template** field, select an existing template from the dropdown +4. The **Title**, **Description**, and **Content** fields are automatically populated from the template +5. Edit any fields as needed +6. Click **Submit** to save the note + +!!! info "Template Filters" + The template dropdown only shows templates that are applicable to the current model type, plus any templates that are not restricted to a specific model type. + +### Managing Note Templates + +Note templates are managed by staff users via the **Admin Center**. + +To access note templates: + +1. Navigate to **Settings** > **Admin Center** +2. Select the **Note Templates** panel + +This panel provides the same rich-text editor interface used for regular notes. Templates created here are available to all users when adding notes across the system. + +#### Creating a Template + +1. In the **Note Templates** panel, click **Add Note Template** +2. Enter a **Title** (required) and optional **Description** +3. Optionally select a **Model Type** to restrict the template to a specific kind of object (e.g. *Part*, *Build Order*). Leave blank to make the template available for all model types +4. Click **Submit**, then edit the template content in the editor + +#### Editing a Template + +Select a template from the sidebar, then use the same edit workflow as for regular notes: click the {{ icon("pencil") }} icon, make changes, and save with {{ icon("device-floppy") }} or **Ctrl+S** / **Cmd+S**. + +#### Deleting a Template + +Open the actions menu in the template header and select **Delete Note Template**. + +!!! note + Deleting a template does not affect any notes that were previously created from it. diff --git a/docs/docs/manufacturing/build.md b/docs/docs/manufacturing/build.md index 9e07f65580..7652732091 100644 --- a/docs/docs/manufacturing/build.md +++ b/docs/docs/manufacturing/build.md @@ -193,9 +193,9 @@ Files attachments can be uploaded against the build order, and displayed in the ### Notes -Build order notes (which support markdown formatting) are displayed in the *Notes* tab: +One or more rich-text notes can be attached to a build order, and are displayed in the *Notes* tab. -{{ image("build/build_notes.png", title="Notes") }} +[Read about notes](../concepts/notes.md). ## External Build Orders diff --git a/docs/docs/part/views.md b/docs/docs/part/views.md index e16e8c0b81..9ad7cfa7ef 100644 --- a/docs/docs/part/views.md +++ b/docs/docs/part/views.md @@ -149,4 +149,6 @@ The *Part Attachments* tab displays file attachments associated with the selecte ### Notes -A part may have notes attached, which support markdown formatting. +A part may have one or more rich-text notes attached. + +[Read about notes](../concepts/notes.md). diff --git a/docs/docs/plugins/develop.md b/docs/docs/plugins/develop.md index 647e7c77cb..329ced57d4 100644 --- a/docs/docs/plugins/develop.md +++ b/docs/docs/plugins/develop.md @@ -23,7 +23,7 @@ Consider the use-case for your plugin and define the exact function of the plugi - Do you need to run in the background ([ScheduleMixin](./mixins/schedule.md)) or when things in InvenTree change ([EventMixin](./mixins/event.md))? - Does the plugin need configuration that should be user changeable ([SettingsMixin](./mixins/settings.md)) or static (just use a yaml in the config dir)? - You want to receive webhooks? Do not code your own untested function, use the WebhookEndpoint model as a base and override the perform_action method. -- Do you need the full power of Django with custom models and all the complexity that comes with that – welcome to the danger zone and [AppMixin](./mixins/app.md). The plugin will be treated as a app by django and can maybe rack the whole instance. +- Do you need the full power of Django with custom models and all the complexity that comes with that - welcome to the danger zone and [AppMixin](./mixins/app.md). The plugin will be treated as a app by django and can maybe rack the whole instance. ### Define Metadata diff --git a/docs/docs/report/helpers.md b/docs/docs/report/helpers.md index dbbe7306ad..2d1723fb14 100644 --- a/docs/docs/report/helpers.md +++ b/docs/docs/report/helpers.md @@ -979,9 +979,98 @@ Length: {{ length_value }} {% endraw %} ``` +## Notes + +[Notes](../concepts/notes.md) are rich-text documents that can be attached to most InvenTree model instances. Two template tags are available for accessing note content in a report. + +### note + +The `note` tag returns the rendered HTML content of a note, ready to embed directly in a report. Any images embedded in the note are automatically resolved to their base64-encoded data so that they appear in the generated PDF. + +::: report.templatetags.report.note + options: + show_docstring_description: false + show_source: False + +If no `title` argument is given, the [primary note](../concepts/notes.md#primary-note) is returned. If a `title` is given, the note whose title matches (case-insensitively) is returned instead. An empty string is returned when no matching note exists. + +#### Example + +```html +{% raw %} +{% load report %} + + +{% note part as part_note %} +
{{ part_note }}
+ + +{% note part "Assembly Instructions" as instructions %} +
{{ instructions }}
+{% endraw %} +``` + +!!! info "Safe HTML Output" + The `note` tag returns pre-sanitized HTML and is marked safe for direct template rendering. Do **not** additionally wrap it with `| safe` or `| markdownify` — the content has already been processed. + +### note_instance + +The `note_instance` tag returns the `Note` object itself, giving access to its individual fields. This is useful when you need to display the note title, description, or metadata alongside its content. + +::: report.templatetags.report.note_instance + options: + show_docstring_description: false + show_source: False + +A `Note` object exposes the following attributes: + +| Attribute | Description | +| --- | --- | +| `title` | The title of the note | +| `description` | An optional short description of the note | +| `content` | The raw HTML content of the note | +| `primary` | `True` if this is the primary note for the model instance | +| `updated` | Timestamp of the last modification | +| `updated_by` | The user who last modified the note | + +#### Example + +```html +{% raw %} +{% load report %} + +{% note_instance part as primary_note %} +{% if primary_note %} +

{{ primary_note.title }}

+{% if primary_note.description %}

{{ primary_note.description }}

{% endif %} +{% note part as note_content %} +
{{ note_content }}
+{% endif %} +{% endraw %} +``` + +### Iterating Over All Notes + +When a model has multiple notes and you want to render all of them, access the `notes` queryset directly: + +```html +{% raw %} +{% load report %} + +{% for n in part.notes.all %} +

{{ n.title }}

+{% note part n.title as note_content %} +
{{ note_content }}
+{% endfor %} +{% endraw %} +``` + ## Rendering Markdown -Some data fields (such as the *Notes* field available on many internal database models) support [markdown formatting](https://en.wikipedia.org/wiki/Markdown). To render markdown content in a custom report, there are template filters made available through the [django-markdownify](https://github.com/erwinmatijsen/django-markdownify) library. This library provides functionality for converting markdown content to HTML representation, allowing it to be then rendered to PDF by the InvenTree report generation pipeline. +Some data fields (such as those provided by custom plugin models) may support [markdown formatting](https://en.wikipedia.org/wiki/Markdown). To render markdown content in a custom report, there are template filters made available through the [django-markdownify](https://github.com/erwinmatijsen/django-markdownify) library. This library provides functionality for converting markdown content to HTML representation, allowing it to be then rendered to PDF by the InvenTree report generation pipeline. + +!!! info "Notes" + [Notes](../concepts/notes.md) content is rich-text (stored as HTML) rather than markdown, and is already sanitized. Use the [note](#note) tag to render it - do not pass it through `markdownify`. To render markdown content in a report, consider the following simplified example: @@ -990,9 +1079,9 @@ To render markdown content in a report, consider the following simplified exampl {% load markdownify %} -

Part Notes

+

Description

- {{ part.notes | markdownify }} + {{ some_markdown_field | markdownify }}

{% endraw %} ``` diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index bc9647c8cd..11f6b9e40a 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -107,6 +107,7 @@ nav: - Project Codes: concepts/project_codes.md - Attachments: concepts/attachments.md - Parameters: concepts/parameters.md + - Notes: concepts/notes.md - Tags: concepts/tags.md - Barcodes: - Barcode Support: barcodes/index.md diff --git a/src/backend/InvenTree/InvenTree/api_version.py b/src/backend/InvenTree/InvenTree/api_version.py index 102f254444..359a1da26b 100644 --- a/src/backend/InvenTree/InvenTree/api_version.py +++ b/src/backend/InvenTree/InvenTree/api_version.py @@ -1,11 +1,16 @@ """InvenTree API version information.""" # InvenTree API version -INVENTREE_API_VERSION = 536 +INVENTREE_API_VERSION = 537 """Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" INVENTREE_API_TEXT = """ +v537 -> 2026-08-31 : https://github.com/inventree/InvenTree/pull/11971 + - Removes direct "notes" field from any models which previously supported markdown notes + - Adds a generic "Note" model which can be attached to any model type via a generic foreign key relationship + - Allow multiple notes to be attached to a single object, and for notes to be created / edited / deleted via the API + v536 -> 2026-08-30 : https://github.com/inventree/InvenTree/pull/xxxx - Adds SCIM 2 provisioning support @@ -61,7 +66,7 @@ v520 -> 2026-07-11 : https://github.com/inventree/InvenTree/pull/12310 - Adds new "disassemble" API endpoint for stock items - Allows a stock item to be broken down into component parts, based on its Bill of Materials -v519 -> 2026-07-09 : https://github.com/inventree/InvenTree/pull/TODO +v519 -> 2026-07-09 : https://github.com/inventree/InvenTree/pull/12334 - Adds optional "roles" and "permissions" fields to the /user/me/ API endpoint, via the "?roles=true" query parameter v518 -> 2026-07-09 : https://github.com/inventree/InvenTree/pull/12341 diff --git a/src/backend/InvenTree/InvenTree/apps.py b/src/backend/InvenTree/InvenTree/apps.py index 1cbf4d11c7..f1be268662 100644 --- a/src/backend/InvenTree/InvenTree/apps.py +++ b/src/backend/InvenTree/InvenTree/apps.py @@ -100,11 +100,11 @@ class InvenTreeConfig(AppConfig): def remove_obsolete_tasks(self): """Delete any obsolete scheduled tasks in the database.""" obsolete = [ + 'data_exporter.tasks.cleanup_old_export_outputs', 'InvenTree.tasks.delete_expired_sessions', - 'stock.tasks.delete_old_stock_items', 'label.tasks.cleanup_old_label_outputs', 'report.tasks.cleanup_old_report_outputs', - 'data_exporter.tasks.cleanup_old_export_outputs', + 'stock.tasks.delete_old_stock_items', ] try: diff --git a/src/backend/InvenTree/InvenTree/filters.py b/src/backend/InvenTree/InvenTree/filters.py index 44319b843f..0e175849ab 100644 --- a/src/backend/InvenTree/InvenTree/filters.py +++ b/src/backend/InvenTree/InvenTree/filters.py @@ -37,6 +37,14 @@ class InvenTreeSearchFilter(filters.SearchFilter): - search_notes: If True, 'notes' is added to the search_fields if it isn't already present - search_regex: If True, search is performed on 'regex' comparison """ + from InvenTree.models import InvenTreeNoteMixin + + # Set (and read, in filter_queryset) on self rather than returned some other + # way, since get_search_fields() only returns the field list, not the + # queryset - and DRF instantiates a fresh filter backend per request, so + # this doesn't leak state across requests. + self._search_notes_fans_out = False + search_notes = InvenTree.helpers.str2bool( request.query_params.get('search_notes', False) ) @@ -45,7 +53,23 @@ class InvenTreeSearchFilter(filters.SearchFilter): if search_notes and 'notes' not in search_fields: # don't modify existing list, create a new object so further queries aren't affected - search_fields = [*search_fields, 'notes'] + + model = view.get_serializer_class().Meta.model + + notes_field: str = '' + + if issubclass(model, InvenTreeNoteMixin): + notes_field = 'notes_list__content' + elif hasattr(model, 'notes'): + notes_field = 'notes' + + if notes_field: + search_fields = [*search_fields, notes_field] + # notes_list__content traverses a reverse one-to-many relation (an + # instance can have multiple notes) - the queryset needs + # deduplicating afterwards, or an instance with 2+ matching notes + # is returned once per matching note instead of once overall. + self._search_notes_fans_out = notes_field == 'notes_list__content' regex = InvenTree.helpers.str2bool( request.query_params.get('search_regex', False) @@ -62,6 +86,15 @@ class InvenTreeSearchFilter(filters.SearchFilter): return fields + def filter_queryset(self, request, queryset, view): + """Apply the search filter, then deduplicate if notes search fanned out the join.""" + queryset = super().filter_queryset(request, queryset, view) + + if getattr(self, '_search_notes_fans_out', False): + queryset = queryset.distinct() + + return queryset + def get_search_terms(self, request): """Return the search terms for this search request. diff --git a/src/backend/InvenTree/InvenTree/helpers.py b/src/backend/InvenTree/InvenTree/helpers.py index 792fd1b002..c4f10fe742 100644 --- a/src/backend/InvenTree/InvenTree/helpers.py +++ b/src/backend/InvenTree/InvenTree/helpers.py @@ -29,12 +29,6 @@ from PIL import Image from stdimage.models import StdImageField, StdImageFieldFile from common.currency import currency_code_default -from InvenTree.sanitizer import ( - DEAFAULT_ATTRS, - DEFAULT_CSS, - DEFAULT_PROTOCOLS, - DEFAULT_TAGS, -) logger = structlog.get_logger('inventree') @@ -954,63 +948,6 @@ def remove_non_printable_characters(value: str, remove_newline=True) -> str: return cleaned -def clean_markdown(value: str) -> str: - """Clean a markdown string. - - This function will remove javascript and other potentially harmful content from the markdown string. - """ - import markdown - - try: - markdownify_settings = settings.MARKDOWNIFY['default'] - except (AttributeError, KeyError): - markdownify_settings = {} - - extensions = markdownify_settings.get('MARKDOWN_EXTENSIONS', []) - extension_configs = markdownify_settings.get('MARKDOWN_EXTENSION_CONFIGS', {}) - - # Generate raw HTML from provided markdown (without sanitizing) - # Note: The 'html' output_format is required to generate self closing tags, e.g. instead of - html = markdown.markdown( - value or '', - extensions=extensions, - extension_configs=extension_configs, - output_format='html', - ) - - # nh3 sanitizer settings - whitelist_tags = markdownify_settings.get('WHITELIST_TAGS', DEFAULT_TAGS) - whitelist_attrs = markdownify_settings.get('WHITELIST_ATTRS', DEAFAULT_ATTRS) - whitelist_styles = markdownify_settings.get('WHITELIST_STYLES', DEFAULT_CSS) - whitelist_protocols = markdownify_settings.get( - 'WHITELIST_PROTOCOLS', DEFAULT_PROTOCOLS - ) - - # Convert bleach-style attributes (list or dict) to nh3-compatible dict format - if isinstance(whitelist_attrs, (list, tuple, set, frozenset)): - attrs_dict = {'*': set(whitelist_attrs)} - elif isinstance(whitelist_attrs, dict): - attrs_dict = {tag: set(allowed) for tag, allowed in whitelist_attrs.items()} - else: - attrs_dict = None - - # Clean the HTML content (for comparison). This must be the same as the original content - clean_html = nh3.clean( - html, - tags=set(whitelist_tags), - attributes=attrs_dict, - url_schemes=set(whitelist_protocols), - filter_style_properties=set(whitelist_styles), - link_rel=None, - strip_comments=True, - ) - - if html != clean_html: - raise ValidationError(_('Data contains prohibited markdown content')) - - return value - - def hash_barcode(barcode_data: str) -> str: """Calculate a 'unique' hash for a barcode string. diff --git a/src/backend/InvenTree/InvenTree/mixins.py b/src/backend/InvenTree/InvenTree/mixins.py index 6de3cf417c..8240ae353b 100644 --- a/src/backend/InvenTree/InvenTree/mixins.py +++ b/src/backend/InvenTree/InvenTree/mixins.py @@ -1,18 +1,12 @@ """Mixins for (API) views in the whole project.""" -from django.core.exceptions import FieldDoesNotExist - from rest_framework import generics, mixins, status from rest_framework.response import Response import data_exporter.mixins import importer.mixins -from InvenTree.fields import InvenTreeNotesField, OutputConfiguration -from InvenTree.helpers import ( - clean_markdown, - remove_non_printable_characters, - strip_html_tags, -) +from InvenTree.fields import OutputConfiguration +from InvenTree.helpers import remove_non_printable_characters, strip_html_tags from InvenTree.schema import schema_for_view_output_options from InvenTree.serializers import FilterableSerializerMixin @@ -58,38 +52,10 @@ class CleanBase: """Clean / sanitize a single input string.""" cleaned = data - # By default, newline characters are removed - remove_newline = True - is_markdown = False - - try: - if hasattr(self, 'serializer_class'): - model = self.serializer_class.Meta.model - field_base = model._meta.get_field(field) - - # The following field types allow newline characters - allow_newline = [(InvenTreeNotesField, True)] - - for field_type in allow_newline: - if issubclass(type(field_base), field_type[0]): - remove_newline = False - is_markdown = field_type[1] - break - - except AttributeError: - pass - except FieldDoesNotExist: - pass - - cleaned = remove_non_printable_characters( - cleaned, remove_newline=remove_newline - ) + cleaned = remove_non_printable_characters(cleaned, remove_newline=True) cleaned = strip_html_tags(cleaned, field_name=field) - if is_markdown: - cleaned = clean_markdown(cleaned) - return cleaned def clean_data(self, data: dict) -> dict: diff --git a/src/backend/InvenTree/InvenTree/models.py b/src/backend/InvenTree/InvenTree/models.py index 8541b5a1a9..d9a1ac0269 100644 --- a/src/backend/InvenTree/InvenTree/models.py +++ b/src/backend/InvenTree/InvenTree/models.py @@ -29,7 +29,6 @@ from taggit.managers import TaggableManager import common.settings import InvenTree.exceptions -import InvenTree.fields import InvenTree.format import InvenTree.helpers import InvenTree.helpers_model @@ -667,14 +666,14 @@ class InvenTreeParameterMixin(InvenTreePermissionCheckMixin, models.Model): return params - def check_parameter_delete(self, parameter): + def check_parameter_delete(self, parameter) -> bool: """Run a check to determine if the provided parameter can be deleted. The default implementation always returns True, but this can be overridden in the implementing class. """ return True - def check_parameter_save(self, parameter): + def check_parameter_save(self, parameter) -> bool: """Run a check to determine if the provided parameter can be saved. The default implementation always returns True, but this can be overridden in the implementing class. @@ -682,6 +681,159 @@ class InvenTreeParameterMixin(InvenTreePermissionCheckMixin, models.Model): return True +class InvenTreeNoteMixin(InvenTreePermissionCheckMixin, models.Model): + """Provides an abstracted class for managing notes. + + Links the implementing model to the common.models.Note table, + and provides multiple accessor / helper methods. + """ + + class Meta: + """Metaclass options for InvenTreeNoteMixin.""" + + abstract = True + + # Define a reverse relation to the Note model + notes_list = GenericRelation( + 'common.Note', content_type_field='model_type', object_id_field='model_id' + ) + + @property + def notes(self) -> QuerySet: + """Return a queryset containing all notes for this model.""" + # Check the query cache for pre-fetched parameters + if cache := getattr(self, '_prefetched_objects_cache', None): + if 'notes_list' in cache: + return cache['notes_list'] + + return self.notes_list.all() + + def delete(self, *args, **kwargs): + """Handle the deletion of a model instance. + + Before deleting the model instance, delete any associated notes. + """ + self.notes_list.all().delete() + super().delete(*args, **kwargs) + + @transaction.atomic + def copy_notes_from(self, other, **kwargs): + """Copy all notes from another model instance. + + Arguments: + other: The other model instance to copy notes from + """ + import os + + from django.core.files.base import ContentFile + + import common.models + + content_type = ContentType.objects.get_for_model(self.__class__) + + # Prefetch each note's images in a single extra query, rather than + # one 'images.all()' query per note. + # + # Sort so primary note is saved last — Note.save() promotes the last + # note saved with primary=True, which correctly mirrors the source. + # This (and the resulting demotion of sibling notes) is real business + # logic in Note.save(), so notes must still be saved one at a time, + # in this order - unlike common.migrations.0051's data migration, + # which bulk_create()s notes directly, this can't do the same: that + # migration operates on a historical model with no custom + # save()/clean() methods at all, so there's no primary-flag logic to + # preserve there in the first place. + source_notes = sorted( + other.notes.all().prefetch_related('images'), key=lambda n: n.primary + ) + + for source_note in source_notes: + new_note = common.models.Note( + model_type=content_type, + model_id=self.pk, + primary=source_note.primary, + title=source_note.title, + description=source_note.description, + content=source_note.content, + ) + new_note.save() + + # Read each source image's file data and write it to storage up front, + # then bulk_create() all of this note's NotesImage rows in one INSERT + # instead of one save() per image - unlike Note, NotesImage has no + # save()-time business logic, so this is safe to batch. + new_images = [] + + for img in source_note.images.all(): + if not img.image: + continue + + old_url = img.image.url + filename = os.path.basename(img.image.name) + + try: + img.image.open('rb') + data = img.image.read() + finally: + img.image.close() + + new_img = common.models.NotesImage(note=new_note, user=img.user) + # save=False: still writes the file to storage (and assigns the + # resulting name/url), but defers the NotesImage row itself to + # the bulk_create() below + new_img.image.save(filename, ContentFile(data), save=False) + new_images.append((old_url, new_img)) + + if new_images: + common.models.NotesImage.objects.bulk_create([ + new_img for _, new_img in new_images + ]) + + content_updated = False + + for old_url, new_img in new_images: + if old_url in new_note.content: + new_note.content = new_note.content.replace( + old_url, new_img.image.url + ) + content_updated = True + + if content_updated: + new_note.save() + + @property + def primary_note(self): + """Return the primary note for this model instance, if it exists.""" + return self.notes_list.all().order_by('-primary').first() + + def get_note(self, title: Optional[str] = None): + """Return a Note instance for the given note title. + + Arguments: + title: Title of the note to retrieve. If None, returns the primary note (if it exists) + """ + notes = self.notes_list.all().order_by('-primary') + + if title: + notes = notes.filter(title=title) + + return notes.first() + + def check_note_delete(self, note) -> bool: + """Run a check to determine if the provided note can be deleted. + + The default implementation always returns True, but this can be overridden in the implementing class. + """ + return True + + def check_note_save(self, note) -> bool: + """Run a check to determine if the provided note can be saved. + + The default implementation always returns True, but this can be overridden in the implementing class. + """ + return True + + class InvenTreeAttachmentMixin(InvenTreePermissionCheckMixin): """Provides an abstracted class for managing file attachments. @@ -1321,51 +1473,6 @@ class PathStringMixin(models.Model): ] -class InvenTreeNotesMixin(models.Model): - """A mixin class for adding notes functionality to a model class. - - The following fields are added to any model which implements this mixin: - - - notes : A text field for storing notes - """ - - class Meta: - """Metaclass options for this mixin. - - Note: abstract must be true, as this is only a mixin, not a separate table - """ - - abstract = True - - def delete(self, *args, **kwargs): - """Custom delete method for InvenTreeNotesMixin. - - - Before deleting the object, check if there are any uploaded images associated with it. - - If so, delete the notes first - """ - from common.models import NotesImage - - images = NotesImage.objects.filter( - model_type=self.__class__.__name__.lower(), model_id=self.pk - ) - - if images.exists(): - logger.info( - 'Deleting %s uploaded images associated with %s <%s>', - images.count(), - self.__class__.__name__, - self.pk, - ) - - images.delete() - - super().delete(*args, **kwargs) - - notes = InvenTree.fields.InvenTreeNotesField( - verbose_name=_('Notes'), help_text=_('Markdown notes (optional)') - ) - - class InvenTreeTagsMixin(models.Model): """A mixin class for adding tag functionality to a model class. diff --git a/src/backend/InvenTree/InvenTree/sanitizer.py b/src/backend/InvenTree/InvenTree/sanitizer.py index 3cca365cdb..8362a92e4c 100644 --- a/src/backend/InvenTree/InvenTree/sanitizer.py +++ b/src/backend/InvenTree/InvenTree/sanitizer.py @@ -224,7 +224,7 @@ ALLOWED_ATTRIBUTES_SVG = [ ] # Default allowlists (matching bleach's original defaults) -# TODO: I do not see us needing a bunch of these but I do not want to introduce a breaking change; we might want to narroy this down with the next breaking change +# TODO: I do not see us needing a bunch of these but I do not want to introduce a breaking change; we might want to narrow this down with the next breaking change DEFAULT_TAGS = frozenset([ 'a', 'abbr', @@ -239,7 +239,7 @@ DEFAULT_TAGS = frozenset([ 'strong', 'ul', ]) -DEAFAULT_ATTRS = {'a': {'href', 'title'}, 'abbr': {'title'}, 'acronym': {'title'}} +DEFAULT_ATTRS = {'a': {'href', 'title'}, 'abbr': {'title'}, 'acronym': {'title'}} DEFAULT_CSS = frozenset([ 'azimuth', 'background-color', diff --git a/src/backend/InvenTree/InvenTree/sentry.py b/src/backend/InvenTree/InvenTree/sentry.py index 20db903b8b..da5d943872 100644 --- a/src/backend/InvenTree/InvenTree/sentry.py +++ b/src/backend/InvenTree/InvenTree/sentry.py @@ -81,7 +81,7 @@ def report_exception(exc, scope: Optional[dict] = None): # pragma: no cover if any(isinstance(exc, e) for e in sentry_ignore_errors()): return - # Error may also be passed in from the loggingn context + # Error may also be passed in from the logging context if hasattr(exc, 'event'): event = getattr(exc, 'event', None) diff --git a/src/backend/InvenTree/InvenTree/serializers.py b/src/backend/InvenTree/InvenTree/serializers.py index b1f0f5ce80..663cf61f51 100644 --- a/src/backend/InvenTree/InvenTree/serializers.py +++ b/src/backend/InvenTree/InvenTree/serializers.py @@ -21,7 +21,6 @@ from drf_spectacular.utils import extend_schema_field from rest_framework import serializers from rest_framework.exceptions import ValidationError from rest_framework.fields import empty -from rest_framework.mixins import ListModelMixin from rest_framework.permissions import SAFE_METHODS from rest_framework.serializers import DecimalField, Serializer from rest_framework.utils import model_meta @@ -1001,30 +1000,6 @@ class CustomStatusSerializerMixin(serializers.Serializer): ) -class NotesFieldMixin: - """Serializer mixin for handling 'notes' fields. - - The 'notes' field will be hidden in a LIST serializer, - but available in a DETAIL serializer. - """ - - def __init__(self, *args, **kwargs): - """Remove 'notes' field from list views.""" - super().__init__(*args, **kwargs) - - if hasattr(self, 'context'): - request = self.context.get('request', None) - method = getattr(request, 'method', None) - - if view := self.context.get('view', None): - if ( - issubclass(view.__class__, ListModelMixin) - and method in SAFE_METHODS - and not InvenTree.ready.isGeneratingSchema() - ): - self.fields.pop('notes', None) - - class ContentTypeField(serializers.ChoiceField): """Serializer field which represents a ContentType as 'app_label.model_name'. @@ -1131,19 +1106,13 @@ class DuplicateOptionsSerializer(serializers.Serializer): 'copy_parameters', _('Copy Parameters'), _('Copy parameters from the original item'), - False, - ), - ( - 'copy_lines', - _('Copy Lines'), - _('Copy line items from the original order'), - False, ), + ('copy_notes', _('Copy Notes'), _('Copy notes from the original item')), + ('copy_lines', _('Copy Lines'), _('Copy line items from the original order')), ( 'copy_extra_lines', _('Copy Extra Lines'), _('Copy extra line items from the original order'), - False, ), ] @@ -1177,8 +1146,8 @@ class DuplicateOptionsSerializer(serializers.Serializer): copy_field_names = [spec['name'] for spec in copy_fields] # Apply "default" fields - for name, label, help_text, default_value in self.DEFAULT_FIELDS: - popped_value = kwargs.pop(name, default_value) + for name, label, help_text in self.DEFAULT_FIELDS: + popped_value = kwargs.pop(name, False) if name in copy_field_names: # Manually supplied field, continue @@ -1217,3 +1186,34 @@ class DuplicateOptionsSerializer(serializers.Serializer): label=spec.get('label', spec['name']), help_text=spec.get('help_text', ''), ) + + +def apply_duplicate_copy_options( + instance, duplicate: dict, original, **copy_defaults: bool +) -> None: + """Apply the standard 'copy_' duplicate-options onto a newly duplicated instance. + + Many serializers which support duplication (Part/Company/ManufacturerPart/SupplierPart/ + Build/PurchaseOrder/SalesOrder/ReturnOrder/TransferOrder/SalesOrderShipment) expose a set + of 'copy_' boolean flags (e.g. copy_notes, copy_parameters) which each map onto an + identically-named `instance.copy__from(original)` method. This is the shared dispatch + for that convention, so adding a new flag - e.g. a future copy_attachments, once + InvenTreeAttachmentMixin grows a copy_attachments_from() method - is a one-line addition + at each call site rather than a new copy-pasted `if duplicate.get(...): instance.copy_..._ + from(...)` block. Any duplicate flag whose target method doesn't follow the + copy__from() naming convention (e.g. Part's copy_bom/copy_image/copy_tests, or + StockItem's copy_history/copy_tests) must still be handled separately by the caller. + + Arguments: + instance: The newly created instance to copy data onto + duplicate: The validated 'duplicate' options dict - callers are expected to have + already checked `if duplicate:` before calling this (and extracted `original` + from it), since they still need both to handle their own additional flags + original: The source instance to copy data from + **copy_defaults: One kwarg per 'copy_' flag to apply, e.g. + `copy_notes=True, copy_parameters=True` - the kwarg's value is the default used + if that flag isn't present in `duplicate` + """ + for flag, default in copy_defaults.items(): + if duplicate.get(flag, default): + getattr(instance, f'{flag}_from')(original) diff --git a/src/backend/InvenTree/InvenTree/test_api.py b/src/backend/InvenTree/InvenTree/test_api.py index 8dd1c9f55d..789430a34d 100644 --- a/src/backend/InvenTree/InvenTree/test_api.py +++ b/src/backend/InvenTree/InvenTree/test_api.py @@ -400,6 +400,9 @@ class SearchTests(InvenTreeAPITestCase): def test_search_filters(self): """Test that the regex, whole word, and notes filters are handled correctly.""" + from build.models import Build + from common.models import Note + SEARCH_TERM = 'some note' RE_SEARCH_TERM = 'some (.*) note' @@ -408,10 +411,20 @@ class SearchTests(InvenTreeAPITestCase): {'search': SEARCH_TERM, 'limit': 10, 'part': {}, 'build': {}}, expected_code=200, ) + # No build or part results self.assertEqual(response.data['build']['count'], 0) self.assertEqual(response.data['part']['count'], 0) + # Add a "note" to a build + build = Build.objects.first() + + _note = Note.objects.create( + content='some note', + model_id=build.id, + model_type=build.get_content_type(), + ) + # add the search_notes param response = self.post( reverse('api-search'), @@ -424,8 +437,9 @@ class SearchTests(InvenTreeAPITestCase): }, expected_code=200, ) + # now should have some build results - self.assertEqual(response.data['build']['count'], 4) + self.assertEqual(response.data['build']['count'], 1) # use the regex term response = self.post( @@ -456,7 +470,7 @@ class SearchTests(InvenTreeAPITestCase): expected_code=200, ) # we get our results back! - self.assertEqual(response.data['build']['count'], 4) + self.assertEqual(response.data['build']['count'], 1) # add the search_whole param response = self.post( @@ -474,6 +488,43 @@ class SearchTests(InvenTreeAPITestCase): # No results again self.assertEqual(response.data['build']['count'], 0) + def test_search_notes_distinct(self): + """Test that search_notes does not return duplicate results for multi-note instances. + + notes_list__content traverses a reverse one-to-many relation (an instance can have + multiple notes) - without deduplicating the queryset, an instance with 2+ matching + notes is returned once per matching note instead of once overall. + """ + from build.models import Build + from common.models import Note + + SEARCH_TERM = 'multi note match' + + build = Build.objects.first() + content_type = build.get_content_type() + + # Two separate notes on the same build, both matching the search term + Note.objects.create( + content=f'

first {SEARCH_TERM}

', + model_id=build.id, + model_type=content_type, + ) + Note.objects.create( + content=f'

second {SEARCH_TERM}

', + model_id=build.id, + model_type=content_type, + ) + + response = self.post( + reverse('api-search'), + {'search': SEARCH_TERM, 'limit': 10, 'search_notes': True, 'build': {}}, + expected_code=200, + ) + + # The build must be returned exactly once, not once per matching note + self.assertEqual(response.data['build']['count'], 1) + self.assertEqual(len(response.data['build']['results']), 1) + def test_permissions(self): """Test that users with insufficient permissions are handled correctly.""" # First, remove all roles diff --git a/src/backend/InvenTree/build/fixtures/build.yaml b/src/backend/InvenTree/build/fixtures/build.yaml index 82a52dd413..08d4851310 100644 --- a/src/backend/InvenTree/build/fixtures/build.yaml +++ b/src/backend/InvenTree/build/fixtures/build.yaml @@ -8,7 +8,6 @@ reference: "BO-0001" title: 'Building 7 parts' quantity: 7 - notes: 'Some simple notes' status: 10 # PENDING creation_date: '2019-03-16' link: http://www.google.com @@ -26,7 +25,6 @@ batch: 'B2' status: 40 # COMPLETE quantity: 21 - notes: 'Some more simple notes' creation_date: '2019-03-16' tree_id: 2 level: 0 @@ -42,7 +40,6 @@ batch: 'B2' status: 40 # COMPLETE quantity: 21 - notes: 'Some even more simple notes' creation_date: '2019-03-16' tree_id: 4 level: 0 @@ -58,7 +55,6 @@ batch: 'B4' status: 40 # COMPLETE quantity: 21 - notes: 'Some even even more simple notes' creation_date: '2019-03-16' tree_id: 5 level: 0 @@ -75,7 +71,6 @@ status: 40 # Complete quantity: 10 creation_date: '2019-03-16' - notes: "A thing" tree_id: 3 level: 0 lft: 1 diff --git a/src/backend/InvenTree/build/migrations/0060_remove_build_notes.py b/src/backend/InvenTree/build/migrations/0060_remove_build_notes.py new file mode 100644 index 0000000000..17be175e52 --- /dev/null +++ b/src/backend/InvenTree/build/migrations/0060_remove_build_notes.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.14 on 2026-05-25 12:36 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("build", "0059_build_tags"), + ("common", "0052_remove_notesimage_model_id_and_more") + ] + + operations = [ + migrations.RemoveField( + model_name="build", + name="notes", + ), + ] diff --git a/src/backend/InvenTree/build/models.py b/src/backend/InvenTree/build/models.py index 8f3680bb02..fc872a18f2 100644 --- a/src/backend/InvenTree/build/models.py +++ b/src/backend/InvenTree/build/models.py @@ -88,8 +88,8 @@ class Build( InvenTree.models.InvenTreeParameterMixin, InvenTree.models.InvenTreeAttachmentMixin, InvenTree.models.InvenTreeBarcodeMixin, + InvenTree.models.InvenTreeNoteMixin, InvenTree.models.InvenTreeTagsMixin, - InvenTree.models.InvenTreeNotesMixin, InvenTree.models.ReferenceIndexingMixin, StateTransitionMixin, StatusCodeMixin, diff --git a/src/backend/InvenTree/build/serializers.py b/src/backend/InvenTree/build/serializers.py index 97edd4350d..e4aba183b6 100644 --- a/src/backend/InvenTree/build/serializers.py +++ b/src/backend/InvenTree/build/serializers.py @@ -41,9 +41,9 @@ from InvenTree.serializers import ( InvenTreeDecimalField, InvenTreeModelSerializer, InvenTreeTaggitSerializer, - NotesFieldMixin, OptionalField, PrefetchSpec, + apply_duplicate_copy_options, ) from stock.generators import generate_batch_code from stock.models import StockItem, StockLocation @@ -63,7 +63,6 @@ from .validators import check_build_output class BuildSerializer( CustomStatusSerializerMixin, FilterableSerializerMixin, - NotesFieldMixin, InvenTreeTaggitSerializer, DataImportExportSerializerMixin, InvenTreeCustomStatusSerializerMixin, @@ -105,7 +104,6 @@ class BuildSerializer( 'status_custom_key', 'target_date', 'take_from', - 'notes', 'link', 'issued_by', 'issued_by_detail', @@ -197,7 +195,9 @@ class BuildSerializer( return queryset - duplicate = DuplicateOptionsSerializer(Build.objects.all(), copy_parameters=True) + duplicate = DuplicateOptionsSerializer( + Build.objects.all(), copy_parameters=True, copy_notes=True + ) def __init__(self, *args, **kwargs): """Determine if extra serializer fields are required.""" @@ -213,10 +213,13 @@ class BuildSerializer( instance = super().create(validated_data) if duplicate: - original = duplicate['original'] - - if duplicate.get('copy_parameters', True): - instance.copy_parameters_from(original) + apply_duplicate_copy_options( + instance, + duplicate, + duplicate['original'], + copy_notes=True, + copy_parameters=True, + ) return instance @@ -1558,12 +1561,9 @@ class BuildLineSerializer( # Defer expensive fields which we do not need for this serializer queryset = queryset.defer( - 'build__notes', 'build__metadata', 'bom_item__metadata', - 'bom_item__part__notes', 'bom_item__part__metadata', - 'bom_item__sub_part__notes', 'bom_item__sub_part__metadata', ) diff --git a/src/backend/InvenTree/build/test_api.py b/src/backend/InvenTree/build/test_api.py index 4d71371dba..a895700f96 100644 --- a/src/backend/InvenTree/build/test_api.py +++ b/src/backend/InvenTree/build/test_api.py @@ -11,6 +11,7 @@ from rest_framework import status from build.models import Build, BuildItem, BuildLine from build.status_codes import BuildStatus +from common.models import Note from common.settings import set_global_setting from InvenTree.unit_test import InvenTreeAPITestCase from part.models import BomItem, BomItemSubstitute, Part, PartTestTemplate @@ -608,6 +609,62 @@ class BuildTest(BuildAPITest): self.assertIsNotNone(bo.issued_by) self.assertEqual(bo.issued_by, self.user) + def test_duplicate_copies_notes(self): + """Test that notes are copied when duplicating a Build via the API. + + BuildSerializer declares its 'duplicate' options with copy_notes=True, + so notes should be copied by default (i.e. without explicitly requesting it). + """ + from django.contrib.contenttypes.models import ContentType + + url = reverse('api-build-list') + + part = Part.objects.create( + name='Duplicate Notes Assembly', description='x', assembly=True + ) + + original = Build.objects.create( + part=part, reference='BO-9001', title='Original build', quantity=5 + ) + + Note.objects.create( + model_type=ContentType.objects.get_for_model(Build), + model_id=original.pk, + title='Original Note', + content='

Some build notes

', + ) + + response = self.post( + url, + { + 'reference': 'BO-9002', + 'part': part.pk, + 'quantity': 5, + 'title': 'Duplicate build', + 'duplicate': {'original': original.pk}, + }, + expected_code=201, + ) + + new_build = Build.objects.get(pk=response.data['pk']) + self.assertEqual(new_build.notes.count(), 1) + self.assertEqual(new_build.notes.first().content, '

Some build notes

') + + # Explicitly disabling copy_notes must not copy any notes + response = self.post( + url, + { + 'reference': 'BO-9003', + 'part': part.pk, + 'quantity': 5, + 'title': 'Duplicate build without notes', + 'duplicate': {'original': original.pk, 'copy_notes': False}, + }, + expected_code=201, + ) + no_notes_build = Build.objects.get(pk=response.data['pk']) + self.assertEqual(no_notes_build.notes.count(), 0) + class BuildAllocationTest(BuildAPITest): """Unit tests for allocation of stock items against a build order. diff --git a/src/backend/InvenTree/common/admin.py b/src/backend/InvenTree/common/admin.py index 6815203984..b41889cd9e 100644 --- a/src/backend/InvenTree/common/admin.py +++ b/src/backend/InvenTree/common/admin.py @@ -50,6 +50,15 @@ class SelectionListAdmin(admin.ModelAdmin): inlines = [SelectionListEntryInlineAdmin] +@admin.register(common.models.Note) +class NoteAdmin(admin.ModelAdmin): + """Admin interface for Note objects.""" + + list_display = ('title', 'template', 'model_type', 'model_id', 'primary') + list_filter = ('template', 'model_type') + search_fields = ('title', 'description', 'content') + + @admin.register(common.models.Attachment) class AttachmentAdmin(admin.ModelAdmin): """Admin interface for Attachment objects.""" diff --git a/src/backend/InvenTree/common/api.py b/src/backend/InvenTree/common/api.py index 81610a34ff..596fc40d5d 100644 --- a/src/backend/InvenTree/common/api.py +++ b/src/backend/InvenTree/common/api.py @@ -467,17 +467,38 @@ class ConfigViewSet(viewsets.ReadOnlyModelViewSet): admin_router.register('config', ConfigViewSet, basename='api-config') +class NotesImageFilter(FilterSet): + """Filterset for the NotesImage API endpoint.""" + + class Meta: + """Metaclass options.""" + + model = common.models.NotesImage + fields = ['user', 'note'] + + model_id = rest_filters.NumberFilter( + label=_('Model ID'), field_name='note__model_id' + ) + + model_type = rest_filters.CharFilter(method='filter_model_type', label='Model Type') + + def filter_model_type(self, queryset, name, value): + """Filter queryset to include only Parameters of the given model type.""" + return common.filters.filter_content_type( + queryset, 'note__model_type', value, allow_null=False + ) + + class NotesImageList(ListCreateAPI): """List view for all notes images.""" queryset = common.models.NotesImage.objects.all() serializer_class = common.serializers.NotesImageSerializer permission_classes = [IsAuthenticatedOrReadScope] + filterset_class = NotesImageFilter filter_backends = SEARCH_ORDER_FILTER - search_fields = ['user', 'model_type', 'model_id'] - def perform_create(self, serializer): """Create (upload) a new notes image.""" serializer.save(user=self.request.user) @@ -910,6 +931,105 @@ class AttachmentDetail(AttachmentMixin, RetrieveUpdateDestroyAPI): return super().destroy(request, *args, **kwargs) +class NoteFilter(FilterSet): + """Filterset class for the NoteList API endpoint.""" + + class Meta: + """Metaclass options for the filterset.""" + + model = common.models.Note + fields = ['model_type', 'model_id', 'updated_by', 'template'] + + template = rest_filters.BooleanFilter(label='Template') + + model_type = rest_filters.CharFilter(method='filter_model_type', label='Model Type') + + def filter_model_type(self, queryset, name, value): + """Filter queryset by model type, allowing null for global templates.""" + return common.filters.filter_content_type( + queryset, 'model_type', value, allow_null=True + ) + + +class NoteMixin: + """Mixin class for the Note views.""" + + # Ignore default sanitizing of the 'content' field + # Note: This is handled explicitly in the 'save' method of the Note model + SAFE_FIELDS = ['content'] + + queryset = common.models.Note.objects.all() + serializer_class = common.serializers.NoteSerializer + permission_classes = [IsAuthenticatedOrReadScope] + + def get_queryset(self): + """Filter notes to those the requesting user has view permission for. + + Template notes (no attached model) are always visible. + Regular notes are only visible when the user has 'view' permission + for the model type the note is linked to. + """ + import common.validators + from users.permissions import check_user_permission, prefetch_rule_sets + + qs = super().get_queryset() + user = self.request.user + + if user.is_superuser: + return qs + + # Fetch the user's groups (with prefetched rule sets) once, and reuse it + # for every model type below - otherwise each check_user_permission() + # call re-fetches the same groups/rule-sets from scratch. + groups = prefetch_rule_sets(user) + + allowed_ct_ids = [ + ContentType.objects.get_for_model(model_class).pk + for model_class in common.validators.note_model_types() + if check_user_permission(user, model_class, 'view', groups=groups) + ] + + return qs.filter(Q(template=True) | Q(model_type__in=allowed_ct_ids)) + + +class NoteList(NoteMixin, ListCreateAPI): + """List API endpoint for Note objects.""" + + filter_backends = SEARCH_ORDER_FILTER + filterset_class = NoteFilter + + ordering = '-primary' + ordering_fields = [ + 'model_id', + 'model_type', + 'updated_by', + 'updated', + 'primary', + 'template', + 'title', + ] + search_fields = ['title', 'description', 'content'] + + +class NoteDetail(NoteMixin, RetrieveUpdateDestroyAPI): + """Detail API endpoint for Note objects.""" + + def perform_destroy(self, instance): + """Enforce the same permission rules on delete as on create/update. + + DRF's default destroy() calls instance.delete() directly, bypassing + NoteSerializer.save() (and the permission checks it performs) entirely. + Without this, get_queryset()'s 'view' permission gate is all that + stands between a user and deleting the note. + """ + common.serializers.check_note_change_permission( + self.request.user, + template=instance.template, + model_type=instance.model_type, + ) + super().perform_destroy(instance) + + class ParameterTemplateFilter(FilterSet): """FilterSet class for the ParameterTemplateList API endpoint.""" @@ -1231,6 +1351,82 @@ class ParameterDetail(ParameterMixin, RetrieveUpdateDestroyAPI): """Detail API endpoint for Parameter objects.""" +class InstanceInfoView(APIView): + """Return aggregated attachment/note/parameter counts for a single model instance. + + A single generic lookup (given a model_type + model_id) for any detail page to + drive its Attachments/Notes/Parameters tab notification dots from one request, + instead of each tab independently querying its own list endpoint just to read + a count. + + Each count reuses the filtering (and, for notes, the view-permission gating) + already implemented by the corresponding list endpoint. + """ + + permission_classes = [IsAuthenticatedOrReadScope] + + @extend_schema( + parameters=[ + OpenApiParameter(name='model_type', type=str, required=True), + OpenApiParameter(name='model_id', type=int, required=True), + ], + responses={200: common.serializers.InstanceInfoSerializer}, + ) + def get(self, request, *args, **kwargs): + """Return counts of attachments, notes and parameters for the given instance.""" + from InvenTree.models import ( + InvenTreeAttachmentMixin, + InvenTreeNoteMixin, + InvenTreeParameterMixin, + ) + + model_type = request.query_params.get('model_type') + model_id = request.query_params.get('model_id') + + if not model_type or not model_id: + raise ValidationError({ + 'model_type': _('This field is required'), + 'model_id': _('This field is required'), + }) + + try: + model_id = int(model_id) + except (TypeError, ValueError): + raise ValidationError({'model_id': _('Invalid model ID')}) + + content_type = common.filters.determine_content_type(model_type) + model_class = content_type.model_class() if content_type else None + + counts = {'attachment_count': 0, 'note_count': 0, 'parameter_count': 0} + + if model_class: + if issubclass(model_class, InvenTreeAttachmentMixin): + counts['attachment_count'] = common.models.Attachment.objects.filter( + model_type=model_class.__name__.lower(), model_id=model_id + ).count() + + if issubclass(model_class, InvenTreeNoteMixin): + # Route through NoteList's own get_queryset() (rather than + # re-deriving the view-permission check here) so this count can + # never drift from what the Notes list endpoint actually shows. + note_list_view = NoteList() + note_list_view.request = request + counts['note_count'] = ( + note_list_view + .get_queryset() + .filter(model_type=content_type, model_id=model_id, template=False) + .count() + ) + + if issubclass(model_class, InvenTreeParameterMixin): + counts['parameter_count'] = common.models.Parameter.objects.filter( + model_type=content_type, model_id=model_id + ).count() + + serializer = common.serializers.InstanceInfoSerializer(counts) + return Response(serializer.data) + + @method_decorator(cache_control(public=True, max_age=86400), name='dispatch') class IconList(ListAPI): """List view for available icon packages.""" @@ -1538,8 +1734,6 @@ settings_api_urls = [ common_api_urls = [ # Webhooks path('webhook//', WebhookView.as_view(), name='api-webhook'), - # Uploaded images for notes - path('notes-image-upload/', NotesImageList.as_view(), name='api-notes-image-list'), # Background task information path( 'background-task/', @@ -1571,6 +1765,22 @@ common_api_urls = [ path('', AttachmentList.as_view(), name='api-attachment-list'), ]), ), + # Notes + path( + 'note/', + include([ + # Uploaded images for notes + path('image/', NotesImageList.as_view(), name='api-notes-image-list'), + path( + '/', + include([ + meta_path(common.models.Note), + path('', NoteDetail.as_view(), name='api-note-detail'), + ]), + ), + path('', NoteList.as_view(), name='api-note-list'), + ]), + ), # Parameters and templates path( 'parameter/', @@ -1606,6 +1816,8 @@ common_api_urls = [ path('', ParameterList.as_view(), name='api-parameter-list'), ]), ), + # Aggregated per-instance counts (attachments / notes / parameters) + path('instance-info/', InstanceInfoView.as_view(), name='api-instance-info'), # Metadata path( 'metadata/', diff --git a/src/backend/InvenTree/common/migrations/0024_notesimage_model_id_notesimage_model_type.py b/src/backend/InvenTree/common/migrations/0024_notesimage_model_id_notesimage_model_type.py index 24467f9ba2..681cd2633a 100644 --- a/src/backend/InvenTree/common/migrations/0024_notesimage_model_id_notesimage_model_type.py +++ b/src/backend/InvenTree/common/migrations/0024_notesimage_model_id_notesimage_model_type.py @@ -20,6 +20,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='notesimage', name='model_type', - field=models.CharField(blank=True, null=True, help_text='Target model type for this image', max_length=100, validators=[common.validators.validate_notes_model_type]), + field=models.CharField(blank=True, null=True, help_text='Target model type for this image', max_length=100), ), ] diff --git a/src/backend/InvenTree/common/migrations/0050_note.py b/src/backend/InvenTree/common/migrations/0050_note.py new file mode 100644 index 0000000000..c5382e7a60 --- /dev/null +++ b/src/backend/InvenTree/common/migrations/0050_note.py @@ -0,0 +1,149 @@ +# Generated by Django 5.2.14 on 2026-05-18 14:16 + +import common.validators +import InvenTree.models +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("common", "0049_notificationentry_charfield_uid"), + ("contenttypes", "0002_remove_content_type_name"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name="Note", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "metadata", + models.JSONField( + blank=True, + help_text="JSON metadata field, for use by external plugins", + null=True, + verbose_name="Plugin Metadata", + ), + ), + ( + "updated", + models.DateTimeField( + blank=True, + default=None, + help_text="Timestamp of last update", + null=True, + verbose_name="Updated", + ), + ), + ("model_id", models.PositiveIntegerField( + blank=True, + null=True, + help_text="Target model instance ID for this note", + )), + ( + "title", + models.CharField( + help_text="Note title", max_length=100, verbose_name="Title", + ), + ), + ( + "description", + models.CharField( + blank=True, + help_text="Optional description field", + max_length=250, + verbose_name="Description", + ), + ), + ( + "content", + models.TextField( + blank=True, help_text="Note content", verbose_name="Content", max_length=50000 + ), + ), + ( + "model_type", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="contenttypes.contenttype", + help_text="Target model type for this note", + blank=True, + null=True, + validators=[common.validators.validate_note_model_type] + ), + ), + ( + "template", + models.BooleanField( + default=False, + help_text="Is this note a template (not linked to a specific model instance)?", + verbose_name="Template", + ), + ), + ( + "updated_by", + models.ForeignKey( + blank=True, + help_text="User who last updated this object", + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="%(class)s_updated", + to=settings.AUTH_USER_MODEL, + verbose_name="Update By", + ), + ), + ( + "primary", + models.BooleanField( + default=False, + help_text="Is this the primary note for the associated model?", + verbose_name="Primary", + ), + ) + ], + options={ + "verbose_name": "Note", + "verbose_name_plural": "Notes", + }, + bases=( + InvenTree.models.ContentTypeMixin, + InvenTree.models.PluginValidationMixin, + models.Model, + ), + ), + # Once the 'Note' model has been created, we can add the foreign key to the 'NotesImage' model + # This will (initially) allow null values, so that existing images are not affected + # After the data migration, we will come back and mark this field as non-nullable + migrations.AddField( + model_name="notesimage", + name="note", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="common.note", + related_name='images', + ), + ), + # Add constraint to ensure that only one 'primary' note exists per model instance + migrations.AddConstraint( + model_name="note", + constraint=models.UniqueConstraint( + condition=models.Q(("primary", True), ("template", False)), + fields=("model_type", "model_id"), + name="unique_primary_note_per_model", + ), + ), + ] diff --git a/src/backend/InvenTree/common/migrations/0051_auto_20260525_0956.py b/src/backend/InvenTree/common/migrations/0051_auto_20260525_0956.py new file mode 100644 index 0000000000..bf07ca720e --- /dev/null +++ b/src/backend/InvenTree/common/migrations/0051_auto_20260525_0956.py @@ -0,0 +1,300 @@ +# Generated by Django 5.2.14 on 2026-05-25 09:56 + +import copy +import re + +import nh3 +from tqdm import tqdm + +from django.db import migrations + +# Number of instances processed per Note.bulk_create() / NotesImage.bulk_update() call +BATCH_SIZE = 500 + + +def get_markdownify_settings() -> dict: + """Return the settings for markdownify, or an empty dict if not defined.""" + + from django.conf import settings + + try: + return settings.MARKDOWNIFY['default'] + except (AttributeError, KeyError): + return {} + + +def markdown_to_html(value: str) -> str: + """Convert a markdown string to HTML. + + This function will remove javascript and other potentially harmful content from the markdown string. + """ + import markdown + + markdownify_settings = get_markdownify_settings() + extensions = markdownify_settings.get('MARKDOWN_EXTENSIONS', []) + extension_configs = markdownify_settings.get('MARKDOWN_EXTENSION_CONFIGS', {}) + + html = markdown.markdown( + value or '', + extensions=extensions, + extension_configs=extension_configs, + output_format='html', + ) + + return html + + +def sanitize_note_content(value: str) -> str: + """Strip unsafe HTML from a migrated note's content. + + Mirrors the nh3 allowlist/filtering in common.models.Note.clean() - duplicated rather than + imported so this migration stays self-contained and unaffected by future changes to the live + model (same reasoning as markdown_to_html() above). This is the only write path for Note content + that doesn't go through Note.save()/.clean() (bulk_create() skips both), so without this, a + legacy 'notes' field containing pre-existing raw HTML would be copied into Note.content unsanitized. + """ + if not value: + return value + + attrs = copy.deepcopy(nh3.ALLOWED_ATTRIBUTES) + + for tag in ( + 'span', 'p', 'div', 'img', 'a', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', + 'ul', 'ol', 'li', 'blockquote', 'pre', 'table', 'thead', 'tbody', + 'tr', 'td', 'th', 'colgroup', 'col', + ): + attrs.setdefault(tag, set()).update({'style'}) + + # Allow class on structural tags used by the rich-text editor + for tag in ('div', 'span', 'img', 'table', 'td', 'th', 'col'): + attrs.setdefault(tag, set()).add('class') + + # Allow image attributes used by tiptap-extension-resizable-image + attrs.setdefault('img', set()).update({'data-keep-ratio', 'colwidth'}) + + cleaned = nh3.clean( + value.strip(), + attributes=attrs, + filter_style_properties={ + 'color', 'background-color', 'font-size', 'font-weight', 'font-style', + 'font-family', 'text-decoration', 'text-align', 'border', 'border-color', + 'border-style', 'border-width', 'margin', 'padding', 'column-width', + 'column-height', 'min-width', 'max-width', 'min-height', 'max-height', + 'width', 'height', + }, + ) + + # nh3 does not recognise legacy IE-only CSS expression() calls as + # unsafe, so they survive style attribute filtering - strip them explicitly + return re.sub(r'expression\s*\(', '', cleaned, flags=re.IGNORECASE) + + +def create_notes_batch(Note, NotesImage, content_type, model, instances, unlinked_images): + """Create Note objects (and link any associated images) for a batch of instances. + + Issues a single bulk_create() for the notes, a single query + bulk_update() for + directly-linked images, and a single bulk_update() for images embedded in the + markdown content - instead of one Note.objects.create() and two image queries + *per instance*, which does not scale to tables with large numbers of notes. + + `unlinked_images` is a shared list of not-yet-linked NotesImage objects, computed + once for the whole migration. Matched images are removed from it in place, so an + image can only ever be claimed by one note, matching the original per-instance + query's behaviour (each query only ever saw images not yet linked by a previous + instance). + """ + notes = Note.objects.bulk_create( + [ + Note( + title="Note", # We don't have a title field in the old model, so we'll just use a default value + content=sanitize_note_content(markdown_to_html(instance.notes)), + model_type=content_type, + model_id=instance.pk, + primary=True, + ) + for instance in instances + ], + batch_size=BATCH_SIZE, + ) + + notes_by_model_id = {instance.pk: note for instance, note in zip(instances, notes)} + + # Images directly linked to one of these instances + direct_images = list( + NotesImage.objects.filter( + model_type__iexact=model, model_id__in=list(notes_by_model_id) + ) + ) + for image in direct_images: + image.note = notes_by_model_id[image.model_id] + + # Images not directly linked to any instance, but still referenced in the + # markdown content itself + embedded_images = [] + for instance, note in zip(instances, notes): + matched = [ + image for image in unlinked_images if image.image.url in instance.notes + ] + for image in matched: + image.note = note + embedded_images.append(image) + unlinked_images.remove(image) + + updated_images = direct_images + embedded_images + if updated_images: + NotesImage.objects.bulk_update(updated_images, ['note'], batch_size=BATCH_SIZE) + + return notes + + +def migrate_orphaned_images(Note, NotesImage, content_type, model): + """Preserve any still-unlinked, directly-attached images for the given model. + + create_notes_batch() only processes instances whose legacy 'notes' field is + non-empty (there's no note content to migrate for a blank one), so a directly + linked NotesImage (model_type/model_id set at upload time, independent of + whatever the 'notes' field currently contains) attached to a blank-notes + instance is never picked up by it and would otherwise be silently discarded + by remove_unlinked_images() at the end of this migration. + + Rather than losing these images, create one empty, primary Note per affected + instance to hold them. The 'delete_old_notes_images' scheduled task (see + common.tasks) already handles cleaning up images which remain unreferenced + in their note's content once they age out - same as it always did before + this refactor - so nothing further needs to happen here. + """ + orphaned_images = list( + NotesImage.objects.filter(model_type__iexact=model, note__isnull=True) + ) + + if not orphaned_images: + return + + model_ids = sorted({image.model_id for image in orphaned_images}) + + notes = Note.objects.bulk_create( + [ + Note( + title="Note", + content='', + model_type=content_type, + model_id=model_id, + primary=True, + ) + for model_id in model_ids + ], + batch_size=BATCH_SIZE, + ) + + notes_by_model_id = dict(zip(model_ids, notes)) + + for image in orphaned_images: + image.note = notes_by_model_id[image.model_id] + + NotesImage.objects.bulk_update(orphaned_images, ['note'], batch_size=BATCH_SIZE) + + +def migrate_notes(apps, schema_editor): + """Migrate existing notes to the new Note model.""" + + ContentType = apps.get_model("contenttypes", "ContentType") + + # New target models + Note = apps.get_model('common', 'Note') + NotesImage = apps.get_model('common', 'NotesImage') + + # Images not yet linked to any note, and not directly tied to a model instance - + # candidates for the "embedded in markdown content" match in create_notes_batch(). + # Computed once for the whole migration (matched images are removed as they're + # claimed), rather than being re-queried and re-scanned from scratch for every + # single row being migrated. + unlinked_images = list( + NotesImage.objects.filter(note__isnull=True, model_id__isnull=True).exclude( + image__isnull=True + ) + ) + + for app, model in [ + ('build', 'build'), + ('company', 'company'), + ('company', 'manufacturerpart'), + ('company', 'supplierpart'), + ('order', 'purchaseorder'), + ('order', 'returnorder'), + ('order', 'salesorder'), + ('order', 'salesordershipment'), + ('order', 'transferorder'), + ('part', 'part'), + ('stock', 'stockitem'), + ]: + # Find old model which contains the 'notes' field + OldModel = apps.get_model(app, model) + with_notes = OldModel.objects.exclude(notes__isnull=True).exclude(notes='') + content_type, _created = ContentType.objects.get_or_create(app_label=app, model=model) + + total = with_notes.count() + + if total: + progress = tqdm(total=total, desc=f'Migration common.0051: Migrating notes for {app}.{model}') + + created = 0 + batch = [] + + for instance in with_notes.iterator(chunk_size=BATCH_SIZE): + batch.append(instance) + + if len(batch) >= BATCH_SIZE: + created += len(create_notes_batch(Note, NotesImage, content_type, model, batch, unlinked_images)) + progress.update(len(batch)) + batch = [] + + if batch: + created += len(create_notes_batch(Note, NotesImage, content_type, model, batch, unlinked_images)) + progress.update(len(batch)) + + if created != total: + raise RuntimeError( + f'Expected to create {total} notes for {app}.{model}, but created {created}.' + ) + + # Handle any remaining directly-linked images for instances with blank + # notes - not covered by the with_notes loop above, so this must run + # even when total == 0 (i.e. no instance of this model has any notes + # text at all, but some may still have directly-attached images). + migrate_orphaned_images(Note, NotesImage, content_type, model) + + +def remove_unlinked_images(apps, schema_editor): + """Remove any NoteImage objects which are not linked to a Note instance.""" + + NotesImage = apps.get_model('common', 'NotesImage') + + unlinked_images = NotesImage.objects.filter(note__isnull=True) + + for image in unlinked_images: + image.delete() + + +class Migration(migrations.Migration): + + # Ensure that each app which supports 'notes' is up-to-date first + dependencies = [ + ("common", "0050_note"), + # Other internal apps which have models that support notes + ("build", "0059_build_tags"), + ("company", "0080_company_tags"), + ("order", "0121_add_line_item_discount"), + ("part", "0152_alter_partpricing_currency"), + ("stock", "0125_remove_mptt_fields") + ] + + operations = [ + migrations.RunPython( + code=migrate_notes, + reverse_code=migrations.RunPython.noop, + ), + migrations.RunPython( + code=remove_unlinked_images, + reverse_code=migrations.RunPython.noop, + ) + ] diff --git a/src/backend/InvenTree/common/migrations/0052_remove_notesimage_model_id_and_more.py b/src/backend/InvenTree/common/migrations/0052_remove_notesimage_model_id_and_more.py new file mode 100644 index 0000000000..a0328f5d98 --- /dev/null +++ b/src/backend/InvenTree/common/migrations/0052_remove_notesimage_model_id_and_more.py @@ -0,0 +1,31 @@ +# Generated by Django 5.2.14 on 2026-05-25 12:30 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("common", "0051_auto_20260525_0956"), + ] + + operations = [ + migrations.RemoveField( + model_name="notesimage", + name="model_id", + ), + migrations.RemoveField( + model_name="notesimage", + name="model_type", + ), + migrations.AlterField( + model_name="notesimage", + name="note", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="images", + to="common.note", + ), + ), + ] diff --git a/src/backend/InvenTree/common/models.py b/src/backend/InvenTree/common/models.py index 4d536d9335..204adca8e2 100644 --- a/src/backend/InvenTree/common/models.py +++ b/src/backend/InvenTree/common/models.py @@ -4,11 +4,13 @@ These models are 'generic' and do not fit a particular business logic object. """ import base64 +import copy import hashlib import hmac import json import math import os +import re import uuid from collections import OrderedDict from datetime import timedelta, timezone @@ -42,6 +44,7 @@ from django.urls import reverse from django.utils.timezone import now from django.utils.translation import gettext_lazy as _ +import nh3 import structlog from anymail.signals import inbound, tracking from django_q.signals import post_spawn @@ -1786,42 +1789,6 @@ class NewsFeedEntry(models.Model): ) -def rename_notes_image(instance, filename): - """Function for renaming uploading image file. Will store in the 'notes' directory.""" - fname = os.path.basename(filename) - return os.path.join('notes', fname) - - -class NotesImage(models.Model): - """Model for storing uploading images for the 'notes' fields of various models. - - Simply stores the image file, for use in the 'notes' field (of any models which support markdown). - """ - - image = models.ImageField( - upload_to=rename_notes_image, verbose_name=_('Image'), help_text=_('Image file') - ) - - user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True) - - date = models.DateTimeField(auto_now_add=True) - - model_type = models.CharField( - max_length=100, - blank=True, - null=True, - validators=[common.validators.validate_notes_model_type], - help_text=_('Target model type for this image'), - ) - - model_id = models.IntegerField( - help_text=_('Target model ID for this image'), - blank=True, - null=True, - default=None, - ) - - class CustomUnit(models.Model): """Model for storing custom physical unit definitions. @@ -3027,10 +2994,10 @@ class Parameter( """ from InvenTree.models import InvenTreeParameterMixin - try: - instance = self.content_object - except InvenTree.models.InvenTreeModel.DoesNotExist: - return + # content_object is None (rather than raising) if the target row is + # missing - GenericForeignKey.__get__ catches ObjectDoesNotExist + # internally, it never propagates it. + instance = self.content_object if instance and isinstance(instance, InvenTreeParameterMixin): instance.check_parameter_save(self) @@ -3039,15 +3006,11 @@ class Parameter( """Check if this parameter can be deleted.""" from InvenTree.models import InvenTreeParameterMixin - try: - instance = self.content_object - except InvenTree.models.InvenTreeModel.DoesNotExist: - return + instance = self.content_object if instance and isinstance(instance, InvenTreeParameterMixin): instance.check_parameter_delete(self) - # TODO: Reintroduce validator for model_type model_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) model_id = models.PositiveIntegerField( @@ -3097,6 +3060,339 @@ class Parameter( return self.template.description +class Note( + UpdatedUserMixin, InvenTree.models.MetadataMixin, InvenTree.models.InvenTreeModel +): + """Class which represents a note assigned to a particular model instance. + + Attributes: + model_type: The type of model to which this note is linked + model_id: The ID of the model to which this note is linked + user: The user who created the note + title: The title of the note + description: A description of the note (optional) + content: The content of the note + created: Date/time that the note was created + """ + + NOTES_MAX_LENGTH = 50000 + + class Meta: + """Meta options for Note model.""" + + verbose_name = _('Note') + verbose_name_plural = _('Notes') + + constraints = [ + models.UniqueConstraint( + fields=['model_type', 'model_id'], + condition=models.Q(primary=True, template=False), + name='unique_primary_note_per_model', + ) + ] + + @staticmethod + def get_api_url() -> str: + """Return the API URL associated with the Parameter model.""" + return reverse('api-note-list') + + def validate_constraints(self, exclude=None): + """Validate model constraints, skipping 'unique_primary_note_per_model'. + + That constraint is actively maintained by save() (which demotes any + sibling primary note before saving self), so checking it here against + pre-save DB state would incorrectly reject legitimate primary-flag + promotions that save() would otherwise handle correctly. + """ + constraints = [ + c + for c in self._meta.constraints + if c.name != 'unique_primary_note_per_model' + ] + errors = {} + for constraint in constraints: + try: + constraint.validate(self.__class__, self, exclude=exclude) + except ValidationError as e: + errors = e.update_error_dict(errors) + if errors: + raise ValidationError(errors) + + @transaction.atomic + def save(self, *args, **kwargs): + """Perform custom save checks before saving a Note instance.""" + self.check_save() + + if not self.template: + is_create = self.pk is None + + # Lock sibling notes to serialize concurrent primary-flag updates. + # This only has rows to lock once at least one sibling already + # exists - it cannot lock a row that doesn't exist yet, so it does + # *not* by itself serialize the very first note being created for + # a given model instance (see the is_create handling below). + siblings = ( + Note.objects + .select_for_update() + .filter( + model_type=self.model_type, model_id=self.model_id, template=False + ) + .exclude(pk=self.pk) + ) + + # If this is the *only* note for this model instance, set it as primary + if not siblings.exists(): + self.primary = True + + # Demote sibling notes *before* saving self, so that the partial unique + # constraint on (model_type, model_id, primary=True) is never briefly + # violated by two rows with primary=True existing at once + if self.primary: + siblings.update(primary=False) + + self.clean() + + if is_create and self.primary: + # Phantom-row race: two concurrent creates of the first note for + # the same model instance can both reach here believing they're + # the only (and thus primary) one, since select_for_update() + # above had no existing sibling row to lock either of them + # against. Let the DB's own unique_primary_note_per_model + # constraint arbitrate instead - retry as a non-primary note if + # we lost the race, rather than surfacing a raw IntegrityError. + # A savepoint is required so a failed attempt only rolls back + # this insert, not the whole (outer) atomic transaction. + try: + with transaction.atomic(): + super().save(*args, **kwargs) + except IntegrityError: + self.primary = False + super().save(*args, **kwargs) + else: + super().save(*args, **kwargs) + else: + # Templates skip primary-flag logic entirely + self.primary = False + self.clean() + super().save(*args, **kwargs) + + self.cleanup_images() + + def clean(self): + """Clean / validate the note before saving to the database.""" + from django.core.exceptions import ValidationError + + if not self.template: + if not self.model_type: + raise ValidationError({'model_type': _('This field is required.')}) + if self.model_id is None: + raise ValidationError({'model_id': _('This field is required.')}) + + if self.model_type: + try: + common.validators.validate_note_model_type(self.model_type) + except ValidationError as e: + raise ValidationError({'model_type': e.message}) + + if self.content: + attrs = copy.deepcopy(nh3.ALLOWED_ATTRIBUTES) + + for tag in ( + 'span', + 'p', + 'div', + 'img', + 'a', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'ul', + 'ol', + 'li', + 'blockquote', + 'pre', + 'table', + 'thead', + 'tbody', + 'tr', + 'td', + 'th', + 'colgroup', + 'col', + ): + attrs.setdefault(tag, set()).update({'style'}) + + # Allow class on structural tags used by the rich-text editor + for tag in ('div', 'span', 'img', 'table', 'td', 'th', 'col'): + attrs.setdefault(tag, set()).add('class') + + # Allow image attributes used by tiptap-extension-resizable-image + attrs.setdefault('img', set()).update({'data-keep-ratio', 'colwidth'}) + + self.content = nh3.clean( + self.content.strip(), + attributes=attrs, + filter_style_properties={ + 'color', + 'background-color', + 'font-size', + 'font-weight', + 'font-style', + 'font-family', + 'text-decoration', + 'text-align', + 'border', + 'border-color', + 'border-style', + 'border-width', + 'margin', + 'padding', + 'column-width', + 'column-height', + 'min-width', + 'max-width', + 'min-height', + 'max-height', + 'width', + 'height', + }, + ) + + # nh3 does not recognise legacy IE-only CSS expression() calls as + # unsafe, so they survive style attribute filtering - strip them explicitly + self.content = re.sub( + r'expression\s*\(', '', self.content, flags=re.IGNORECASE + ) + + def check_save(self): + """Check if this note can be saved.""" + from InvenTree.models import InvenTreeNoteMixin + + if self.template or not self.model_type: + return + + # content_object is None (rather than raising) if the target row is + # missing - GenericForeignKey.__get__ catches ObjectDoesNotExist + # internally, it never propagates it. + instance = self.content_object + + if instance and isinstance(instance, InvenTreeNoteMixin): + instance.check_note_save(self) + + def check_delete(self): + """Check if this note can be deleted.""" + from InvenTree.models import InvenTreeNoteMixin + + if self.template or not self.model_type: + return + + instance = self.content_object + + if instance and isinstance(instance, InvenTreeNoteMixin): + instance.check_note_delete(self) + + def delete(self, *args, **kwargs): + """Perform custom delete checks before deleting a Note instance.""" + self.check_delete() + super().delete(*args, **kwargs) + + def cleanup_images(self): + """Remove any images which are no longer referenced in the note content.""" + for image in self.images.all(): + if image.image and image.image.url not in self.content: + image.delete() + + template = models.BooleanField( + default=False, + verbose_name=_('Template'), + help_text=_( + 'Is this note a template (not linked to a specific model instance)?' + ), + ) + + model_type = models.ForeignKey( + ContentType, + on_delete=models.CASCADE, + null=True, + blank=True, + validators=[common.validators.validate_note_model_type], + help_text=_('Target model type for this note'), + ) + + model_id = models.PositiveIntegerField( + null=True, blank=True, help_text=_('Target model instance ID for this note') + ) + + content_object = GenericForeignKey('model_type', 'model_id') + + primary = models.BooleanField( + default=False, + verbose_name=_('Primary'), + help_text=_('Is this the primary note for the associated model?'), + ) + + title = models.CharField( + max_length=100, verbose_name=_('Title'), help_text=_('Note title') + ) + + description = models.CharField( + max_length=250, + blank=True, + verbose_name=_('Description'), + help_text=_('Optional description field'), + ) + + content = models.TextField( + blank=True, + verbose_name=_('Content'), + help_text=_('Note content'), + max_length=NOTES_MAX_LENGTH, + ) + + +def rename_notes_image(instance, filename): + """Function for renaming uploading image file. Will store in the 'notes' directory.""" + fname = os.path.basename(filename) + return os.path.join('notes', fname) + + +class NotesImage(models.Model): + """Model for storing uploading images for the 'notes' fields of various models. + + Simply stores the image file, for use in the 'notes' field (of any models which support markdown). + """ + + image = models.ImageField( + upload_to=rename_notes_image, verbose_name=_('Image'), help_text=_('Image file') + ) + + user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, blank=True) + + date = models.DateTimeField(auto_now_add=True) + + note = models.ForeignKey( + Note, on_delete=models.CASCADE, null=False, blank=False, related_name='images' + ) + + +@receiver(post_delete, sender=NotesImage, dispatch_uid='notesimage_post_delete') +def after_notesimage_deleted(sender, instance, **kwargs): + """Remove the image file from storage once a NotesImage row is deleted. + + A signal (rather than an overridden delete()) is required here: a NotesImage row is + usually removed via a cascade - e.g. deleting its parent Note, or + InvenTreeNoteMixin.delete() bulk-deleting all notes for a model instance being deleted. + Django's deletion Collector never calls a cascaded object's Python-level delete() + override, only its pre_delete/post_delete signals - regardless of whether the cascade + started from a single instance.delete() or a bulk QuerySet.delete(). + """ + if instance.image: + instance.image.delete(save=False) + + class BarcodeScanResult(InvenTree.models.InvenTreeModel): """Model for storing barcode scans results.""" diff --git a/src/backend/InvenTree/common/serializers.py b/src/backend/InvenTree/common/serializers.py index 135539b7d8..7ccb76d04b 100644 --- a/src/backend/InvenTree/common/serializers.py +++ b/src/backend/InvenTree/common/serializers.py @@ -22,7 +22,7 @@ from importer.registry import register_importer from InvenTree.helpers import get_objectreference from InvenTree.helpers_model import construct_absolute_url from InvenTree.mixins import DataImportExportSerializerMixin -from InvenTree.models import InvenTreeParameterMixin +from InvenTree.models import InvenTreeNoteMixin, InvenTreeParameterMixin from InvenTree.serializers import ( ContentTypeField, FilterableSerializerMixin, @@ -404,7 +404,7 @@ class NotesImageSerializer(InvenTreeModelSerializer): """Meta options for NotesImageSerializer.""" model = common_models.NotesImage - fields = ['pk', 'image', 'user', 'date', 'model_type', 'model_id'] + fields = ['pk', 'image', 'user', 'date', 'note'] read_only_fields = ['date', 'user'] @@ -825,7 +825,6 @@ class AttachmentSerializer( def save(self, **kwargs): """Override the save method to handle the model_type field.""" from InvenTree.models import InvenTreeAttachmentMixin - from users.permissions import check_user_permission model_type = self.validated_data.get('model_type', None) @@ -839,23 +838,154 @@ class AttachmentSerializer( model_type ) - if not issubclass(target_model_class, InvenTreeAttachmentMixin): - raise PermissionDenied(_('Invalid model type specified for attachment')) - - permission_error_msg = _( - 'User does not have permission to create or edit attachments for this model' + check_model_change_permission( + user, + target_model_class, + InvenTreeAttachmentMixin, + _('Invalid model type specified for attachment'), + _( + 'User does not have permission to create or edit attachments for this model' + ), ) - if not check_user_permission(user, target_model_class, 'change'): - raise PermissionDenied(permission_error_msg) - - # Check that the user has the required permissions to attach files to the target model - if not target_model_class.check_related_permission('change', user): - raise PermissionDenied(permission_error_msg) - return super().save(**kwargs) +def check_model_change_permission( + user, target_model_class, mixin_class, invalid_model_msg, permission_error_msg +): + """Ensure a user has 'change' permission against a generic-relation target model. + + Shared by any serializer whose save() must verify both that the target model + supports a given mixin (e.g. Attachment/Parameter/Note), and that the user has + 'change' permission against it - the sequence of checks is identical in each + case; only the mixin class and the (separately translated, so callers keep + full-sentence translator context) error messages differ. + + Raises PermissionDenied if the model class is invalid, or the user lacks + permission. + """ + from users.permissions import check_user_permission + + if not target_model_class or not issubclass(target_model_class, mixin_class): + raise PermissionDenied(invalid_model_msg) + + if not check_user_permission(user, target_model_class, 'change'): + raise PermissionDenied(permission_error_msg) + + if not target_model_class.check_related_permission('change', user): + raise PermissionDenied(permission_error_msg) + + +def check_note_change_permission(user, *, template, model_type): + """Check whether a user is permitted to create, edit or delete a note. + + Shared between NoteSerializer.save() (create/update) and NoteDetail's + destroy handling (delete), so all three operations enforce the same rule: + staff-only for templates, model 'change' permission otherwise. + + Raises PermissionDenied if the user is not permitted. + """ + if template: + if not user.is_staff: + raise PermissionDenied( + _('Only staff users can create or edit note templates') + ) + return + + target_model_class = model_type.model_class() if model_type else None + + check_model_change_permission( + user, + target_model_class, + InvenTreeNoteMixin, + _('Invalid model type specified for note'), + _('User does not have permission to create or edit notes for this model'), + ) + + +class NoteSerializer(FilterableSerializerMixin, InvenTreeModelSerializer): + """Serializer for the Note model.""" + + class Meta: + """Meta options for NoteSerializer.""" + + model = common_models.Note + fields = [ + 'pk', + 'template', + 'model_type', + 'model_id', + 'primary', + 'title', + 'description', + 'content', + 'updated', + 'updated_by', + ] + + read_only_fields = ['updated', 'updated_by'] + + def validate(self, data): + """Validate note data — templates need no model_id; regular notes require both.""" + data = super().validate(data) + + is_template = data.get('template', getattr(self.instance, 'template', False)) + + if not is_template: + model_type = data.get('model_type') or getattr( + self.instance, 'model_type', None + ) + model_id = data.get('model_id') or getattr(self.instance, 'model_id', None) + + if not model_type: + raise serializers.ValidationError({ + 'model_type': _('This field is required.') + }) + if model_id is None: + raise serializers.ValidationError({ + 'model_id': _('This field is required.') + }) + + return data + + def save(self, **kwargs): + """Save the Note instance.""" + user = self.context.get('request').user + is_template = self.validated_data.get( + 'template', getattr(self.instance, 'template', False) + ) + model_type = self.validated_data.get('model_type') or ( + self.instance and self.instance.model_type + ) + + check_note_change_permission(user, template=is_template, model_type=model_type) + + return super().save(updated_by=user, **kwargs) + + # Note: The choices are overridden at run-time on class initialization + model_type = ContentTypeField( + mixin_class=InvenTreeNoteMixin, + choices=common.validators.note_model_options, + label=_('Model Type'), + default=None, + allow_null=True, + required=False, + ) + + updated_by_detail = OptionalField( + serializer_class=UserSerializer, + serializer_kwargs={ + 'source': 'updated_by', + 'read_only': True, + 'allow_null': True, + 'many': False, + }, + default_include=True, + prefetch_fields=['updated_by'], + ) + + @register_importer() class ParameterTemplateSerializer( DataImportExportSerializerMixin, InvenTreeModelSerializer @@ -923,9 +1053,6 @@ class ParameterSerializer( def save(self, **kwargs): """Save the Parameter instance.""" - from InvenTree.models import InvenTreeParameterMixin - from users.permissions import check_user_permission - model_type = self.validated_data.get('model_type', None) if model_type is None and self.instance: @@ -936,19 +1063,16 @@ class ParameterSerializer( target_model_class = model_type.model_class() - if not issubclass(target_model_class, InvenTreeParameterMixin): - raise PermissionDenied(_('Invalid model type specified for parameter')) - - permission_error_msg = _( - 'User does not have permission to create or edit parameters for this model' + check_model_change_permission( + user, + target_model_class, + InvenTreeParameterMixin, + _('Invalid model type specified for parameter'), + _( + 'User does not have permission to create or edit parameters for this model' + ), ) - if not check_user_permission(user, target_model_class, 'change'): - raise PermissionDenied(permission_error_msg) - - if not target_model_class.check_related_permission('change', user): - raise PermissionDenied(permission_error_msg) - instance = super().save(updated_by=user, **kwargs) return instance @@ -1132,3 +1256,31 @@ class TestEmailSerializer(serializers.Serializer): fields = ['email'] email = serializers.EmailField(required=True) + + +class InstanceInfoSerializer(serializers.Serializer): + """Serializer for aggregated per-instance counts (attachments, notes, parameters). + + Backs a single generic lookup (see common.api.InstanceInfoView) that any + model instance's detail page can use to drive its Attachments/Notes/ + Parameters tab notification dots from one request, instead of each tab + independently querying its own list endpoint just to read a count. + """ + + attachment_count = serializers.IntegerField( + label=_('Attachment Count'), + help_text=_('Number of attachments associated with this instance'), + read_only=True, + ) + + note_count = serializers.IntegerField( + label=_('Note Count'), + help_text=_('Number of notes associated with this instance'), + read_only=True, + ) + + parameter_count = serializers.IntegerField( + label=_('Parameter Count'), + help_text=_('Number of parameters associated with this instance'), + read_only=True, + ) diff --git a/src/backend/InvenTree/common/tasks.py b/src/backend/InvenTree/common/tasks.py index 43afef5245..2a81c089f0 100644 --- a/src/backend/InvenTree/common/tasks.py +++ b/src/backend/InvenTree/common/tasks.py @@ -1,10 +1,10 @@ """Tasks (processes that get offloaded) for common app.""" -import os from datetime import timedelta from django.conf import settings from django.core.exceptions import AppRegistryNotReady +from django.core.files.storage import default_storage from django.db.utils import IntegrityError, OperationalError from django.utils import timezone @@ -15,8 +15,6 @@ from opentelemetry import trace import common.models import InvenTree.helpers -from InvenTree.helpers_model import getModelsWithMixin -from InvenTree.models import InvenTreeNotesMixin from InvenTree.tasks import ScheduledTask, scheduled_task tracer = trace.get_tracer(__name__) @@ -113,9 +111,16 @@ def update_news_feed(): @tracer.start_as_current_span('delete_old_notes_images') @scheduled_task(ScheduledTask.DAILY) def delete_old_notes_images(): - """Remove old notes images from the database. + """Remove old, unreferenced notes images from the database. - Anything older than ~3 months is removed, unless it is linked to a note + Each NotesImage is linked to a specific Note via a required foreign key, so + (unlike the pre-refactor version of this task) we only need to check whether + the image is still referenced in *that one* note's content, rather than + searching every note-supporting model's table for a matching substring. + + Anything older than ~3 months is removed, unless it is still referenced in + its associated note's content. Images whose file no longer exists in storage + are removed regardless of age, since there's nothing left to keep around. """ try: from common.models import NotesImage @@ -125,53 +130,28 @@ def delete_old_notes_images(): ) return - # Remove any notes which point to non-existent image files - for note in NotesImage.objects.all(): - if not os.path.exists(note.image.path): - logger.info('Deleting note %s - image file does not exist', note.image.path) - note.delete() + # Remove any images whose file no longer exists in storage, regardless of + # age - there's nothing left to keep around + for image in NotesImage.objects.all(): + if not image.image or not default_storage.exists(image.image.name): + logger.info( + 'delete_old_notes_images: Deleting image %s - file does not exist', + image.pk, + ) + image.delete() - note_classes = getModelsWithMixin(InvenTreeNotesMixin) before = InvenTree.helpers.current_date() - timedelta(days=90) - for note in NotesImage.objects.filter(date__lte=before): - # Find any images which are no longer referenced by a note + old_images = NotesImage.objects.filter(date__lte=before).select_related('note') - found = False - - img = note.image.name - - for model in note_classes: - if model.objects.filter(notes__icontains=img).exists(): - found = True - break - - if not found: - logger.info('Deleting note %s - image file not linked to a note', img) - note.delete() - - # Finally, remove any images in the notes dir which are not linked to a note - notes_dir = os.path.join(settings.MEDIA_ROOT, 'notes') - - try: - images = os.listdir(notes_dir) - except FileNotFoundError: - # Thrown if the directory does not exist - images = [] - - all_notes = NotesImage.objects.all() - - for image in images: - found = False - for note in all_notes: - img_path = os.path.basename(note.image.path) - if img_path == image: - found = True - break - - if not found: - logger.info('Deleting note %s - image file not linked to a note', image) - os.remove(os.path.join(notes_dir, image)) + for image in old_images: + if image.image.url not in image.note.content: + logger.info( + 'delete_old_notes_images: Deleting image %s - not referenced by note %s', + image.pk, + image.note.pk, + ) + image.delete() @tracer.start_as_current_span('rebuild_parameters') diff --git a/src/backend/InvenTree/common/test_api.py b/src/backend/InvenTree/common/test_api.py index c530ac1907..d25a3181de 100644 --- a/src/backend/InvenTree/common/test_api.py +++ b/src/backend/InvenTree/common/test_api.py @@ -1136,6 +1136,712 @@ class AttachmentAPITests(InvenTreeAPITestCase): ) +class InstanceInfoAPITests(InvenTreeAPITestCase): + """API tests for the InstanceInfoView (aggregated attachment/note/parameter counts).""" + + roles = [] + + def setUp(self): + """Create a Part instance to query counts against.""" + from part.models import Part + + super().setUp() + + self.part = Part.objects.create(name='Instance Info Test Part', description='x') + + def _url(self, model_type=None, model_id=None): + params = {} + if model_type is not None: + params['model_type'] = model_type + if model_id is not None: + params['model_id'] = model_id + return reverse('api-instance-info'), params + + def test_missing_params(self): + """Both model_type and model_id are required.""" + url, _params = self._url() + response = self.get(url, expected_code=400) + self.assertIn('model_type', response.data) + self.assertIn('model_id', response.data) + + def test_invalid_model_id(self): + """A non-numeric model_id is rejected.""" + url, params = self._url('part', 'not-a-number') + response = self.get(url, data=params, expected_code=400) + self.assertIn('model_id', response.data) + + def test_zero_counts(self): + """A part with no attachments/notes/parameters returns all zeros.""" + url, params = self._url('part', self.part.pk) + response = self.get(url, data=params, expected_code=200) + + self.assertEqual(response.data['attachment_count'], 0) + self.assertEqual(response.data['note_count'], 0) + self.assertEqual(response.data['parameter_count'], 0) + + def test_nonexistent_model_type(self): + """An unsupported/unrecognized model_type returns all zeros, not an error.""" + url, params = self._url('not_a_real_model', 1) + response = self.get(url, data=params, expected_code=200) + + self.assertEqual(response.data['attachment_count'], 0) + self.assertEqual(response.data['note_count'], 0) + self.assertEqual(response.data['parameter_count'], 0) + + def test_counts_reflect_related_objects(self): + """Counts reflect actual attachments/notes/parameters attached to the instance.""" + from django.contrib.contenttypes.models import ContentType + + from common.models import Note, Parameter, ParameterTemplate + from part.models import Part + + # note_count requires 'view' permission on the target model (see + # test_note_count_respects_view_permission for that behaviour in isolation) + self.assignRole('part.view') + + part_ct = ContentType.objects.get_for_model(Part) + + common.models.Attachment.objects.create( + model_type='part', + model_id=self.part.pk, + link='https://example.com', + comment='test attachment', + ) + + Note.objects.create( + model_type=part_ct, model_id=self.part.pk, title='N', content='

x

' + ) + + template = ParameterTemplate.objects.create(name='Colour') + Parameter.objects.create( + template=template, model_type=part_ct, model_id=self.part.pk, data='Red' + ) + + url, params = self._url('part', self.part.pk) + response = self.get(url, data=params, expected_code=200) + + self.assertEqual(response.data['attachment_count'], 1) + self.assertEqual(response.data['note_count'], 1) + self.assertEqual(response.data['parameter_count'], 1) + + def test_note_count_respects_view_permission(self): + """note_count is gated by 'view' permission on the target model, matching NoteList. + + attachment_count / parameter_count are *not* gated (matching AttachmentList / + ParameterList, neither of which apply view-permission filtering today) - this + pins down that intentional asymmetry rather than accidentally widening or + narrowing either behaviour. + """ + from django.contrib.contenttypes.models import ContentType + + from common.models import Note, Parameter, ParameterTemplate + from part.models import Part + + part_ct = ContentType.objects.get_for_model(Part) + + common.models.Attachment.objects.create( + model_type='part', + model_id=self.part.pk, + link='https://example.com', + comment='test attachment', + ) + Note.objects.create( + model_type=part_ct, model_id=self.part.pk, title='N', content='

x

' + ) + template = ParameterTemplate.objects.create(name='Colour') + Parameter.objects.create( + template=template, model_type=part_ct, model_id=self.part.pk, data='Red' + ) + + # No roles assigned - user cannot view Part notes + url, params = self._url('part', self.part.pk) + response = self.get(url, data=params, expected_code=200) + + self.assertEqual(response.data['attachment_count'], 1) + self.assertEqual(response.data['note_count'], 0) + self.assertEqual(response.data['parameter_count'], 1) + + # Once granted view permission, the note becomes visible too + self.assignRole('part.view') + response = self.get(url, data=params, expected_code=200) + self.assertEqual(response.data['note_count'], 1) + + +class NoteAPITests(InvenTreeAPITestCase): + """API tests for the Note model, focusing on the 'primary' flag behaviour.""" + + def setUp(self): + """Create a Part instance to attach notes to.""" + from part.models import Part + + super().setUp() + + self.assignRole('part.add') + + self.part = Part.objects.create( + name='Test Part', description='A part for testing notes' + ) + + def _note_url(self, pk=None): + if pk: + return reverse('api-note-detail', kwargs={'pk': pk}) + return reverse('api-note-list') + + def _create_note(self, title, primary=None, expected_code=201): + data = {'model_type': 'part', 'model_id': self.part.pk, 'title': title} + if primary is not None: + data['primary'] = primary + return self.post(self._note_url(), data=data, expected_code=expected_code) + + def test_first_note_is_primary(self): + """A note created when no other notes exist is automatically primary.""" + response = self._create_note('Only Note') + self.assertTrue(response.data['primary']) + + def test_second_note_not_primary_by_default(self): + """Notes created after the first are not primary by default.""" + first = self._create_note('First Note') + second = self._create_note('Second Note') + + self.assertTrue(first.data['primary']) + self.assertFalse(second.data['primary']) + + # Confirm the first is still marked primary in the database + from common.models import Note + + self.assertTrue(Note.objects.get(pk=first.data['pk']).primary) + + def test_setting_primary_clears_others(self): + """Marking a note as primary demotes all sibling notes.""" + first = self._create_note('First Note') + second = self._create_note('Second Note') + third = self._create_note('Third Note') + + # Only the first should be primary after creation + self.assertTrue(first.data['primary']) + self.assertFalse(second.data['primary']) + self.assertFalse(third.data['primary']) + + # Promote the third note via PATCH + response = self.patch( + self._note_url(third.data['pk']), data={'primary': True}, expected_code=200 + ) + self.assertTrue(response.data['primary']) + + # Verify via the list endpoint that only the third is primary + list_response = self.get( + self._note_url(), + data={'model_type': 'part', 'model_id': self.part.pk}, + expected_code=200, + ) + primary_pks = [n['pk'] for n in list_response.data if n['primary']] + self.assertEqual(primary_pks, [third.data['pk']]) + + def test_primary_flag_isolated_per_model_instance(self): + """Primary flag changes on one model instance do not affect notes on another.""" + from part.models import Part + + other_part = Part.objects.create(name='Other Part', description='Another part') + + note_a = self._create_note('Note on Part A') + self.assertTrue(note_a.data['primary']) + + # Create a note on the other part; it should be primary for *that* part + note_b_response = self.post( + self._note_url(), + data={ + 'model_type': 'part', + 'model_id': other_part.pk, + 'title': 'Note on Part B', + }, + expected_code=201, + ) + self.assertTrue(note_b_response.data['primary']) + + # The note on Part A should still be primary + note_a_detail = self.get(self._note_url(note_a.data['pk']), expected_code=200) + self.assertTrue(note_a_detail.data['primary']) + + def test_phantom_row_race_retries_instead_of_500(self): + """Two concurrent creates of the *first* note for an instance must not 500. + + Note.save()'s select_for_update() sibling lock has nothing to lock when no + sibling note exists yet, so it cannot by itself serialize two concurrent + creates of the first note for the same model instance - both can decide + they're primary before either commits. This can't be reproduced + deterministically with real threads inside a TestCase (each test runs + inside one wrapped, uncommitted transaction), so instead force the exact + failure mode Note.save() must handle: make its own first INSERT attempt + collide with the unique_primary_note_per_model constraint, as a genuine + second concurrent request's already-committed row would, and confirm it + retries as a non-primary note instead of letting the IntegrityError + surface as a raw 500. + """ + from unittest import mock + + from django.contrib.contenttypes.models import ContentType + from django.db import IntegrityError + from django.db.models import Model as DjangoModel + + from common.models import Note + + note = Note( + model_type=ContentType.objects.get_for_model(self.part.__class__), + model_id=self.part.pk, + title='Racing Note', + content='', + ) + + original_save = DjangoModel.save + attempts = [] + + def flaky_save(self_obj, *args, **kwargs): + """Fail the first save attempt for `note` only; behave normally otherwise.""" + if self_obj is note and not attempts: + attempts.append(1) + raise IntegrityError( + 'duplicate key value violates unique constraint ' + '"unique_primary_note_per_model"' + ) + return original_save(self_obj, *args, **kwargs) + + with mock.patch.object(DjangoModel, 'save', new=flaky_save): + note.save() + + # Lost the (simulated) race - demoted to non-primary, not left unsaved + self.assertFalse(note.primary) + self.assertTrue(Note.objects.filter(pk=note.pk).exists()) + self.assertEqual(len(attempts), 1) + + +class NoteModelTypeValidationTests(InvenTreeAPITestCase): + """Tests that Note.model_type is restricted to models which support notes. + + Covers both the model-level validator (common.validators.validate_note_model_type, + attached via Note.model_type's `validators` and invoked explicitly in Note.clean(), + so it applies to any code path - not just the DRF serializer) and the API-level + check (ContentTypeField(mixin_class=InvenTreeNoteMixin, ...)) - both derive from + the same InvenTreeNoteMixin-based lookup, rather than maintaining separate lists. + """ + + def test_model_rejects_unsupported_content_type(self): + """Note.full_clean() rejects a content type which does not support notes.""" + from django.contrib.auth import get_user_model + from django.contrib.contenttypes.models import ContentType + from django.core.exceptions import ValidationError + + from common.models import Note + + user_ct = ContentType.objects.get_for_model(get_user_model()) + + note = Note(model_type=user_ct, model_id=1, title='Bad Note') + + with self.assertRaises(ValidationError) as cm: + note.full_clean() + self.assertIn('model_type', cm.exception.message_dict) + + def test_save_rejects_unsupported_content_type(self): + """Note.save() rejects a content type which does not support notes. + + Note.clean() explicitly invokes the shared validator, so this is caught + even when full_clean()/clean_fields() is never called - e.g. direct + Note.objects.create() calls from the admin, shell, or other app code. + """ + from django.contrib.auth import get_user_model + from django.contrib.contenttypes.models import ContentType + from django.core.exceptions import ValidationError + + from common.models import Note + + user_ct = ContentType.objects.get_for_model(get_user_model()) + + with self.assertRaises(ValidationError): + Note.objects.create(model_type=user_ct, model_id=1, title='Bad Note') + + self.assertFalse(Note.objects.filter(title='Bad Note').exists()) + + def test_model_accepts_supported_content_type(self): + """Note.full_clean() accepts a content type which does support notes.""" + from django.contrib.contenttypes.models import ContentType + + from common.models import Note + from part.models import Part + + part_ct = ContentType.objects.get_for_model(Part) + + note = Note(model_type=part_ct, model_id=1, title='Good Note') + note.full_clean() + + def test_api_rejects_unsupported_content_type(self): + """The Note API rejects a model_type which does not support notes.""" + self.assignRole('part.change') + + response = self.post( + reverse('api-note-list'), + data={'model_type': 'auth.user', 'model_id': 1, 'title': 'Bad Note'}, + expected_code=400, + ) + self.assertIn('model_type', response.data) + + +class NoteContentSanitizationTests(InvenTreeAPITestCase): + """Security tests for the Note API 'content' field. + + The content field accepts raw HTML which is sanitized by nh3 before + persistence. These tests verify that known XSS vectors are neutralised + both at the model level (Note.clean()) and through the API (POST/PATCH). + """ + + def setUp(self): + """Create a Part instance to attach notes to.""" + from part.models import Part + + super().setUp() + + self.assignRole('part.add') + + self.part = Part.objects.create( + name='Security Test Part', description='Part for note security testing' + ) + + def _note_url(self, pk=None): + if pk: + return reverse('api-note-detail', kwargs={'pk': pk}) + return reverse('api-note-list') + + def _create_note_with_content(self, content, expected_code=201): + return self.post( + self._note_url(), + data={ + 'model_type': 'part', + 'model_id': self.part.pk, + 'title': 'Security Test Note', + 'content': content, + }, + expected_code=expected_code, + ) + + # ------------------------------------------------------------------------- + # Model-level sanitization (Note.clean() called directly) + # ------------------------------------------------------------------------- + + def test_model_clean_strips_script_tags(self): + """Note.clean() removes

Safe content

", + ) + note.clean() + self.assertNotIn('text

', + ) + note.clean() + self.assertNotIn('onclick', note.content.lower()) + self.assertIn('text', note.content) + + def test_model_clean_strips_javascript_protocol(self): + """Note.clean() removes javascript: from href attributes.""" + from django.contrib.contenttypes.models import ContentType + + from common.models import Note + + ct = ContentType.objects.get_for_model(self.part.__class__) + note = Note( + model_type=ct, + model_id=self.part.pk, + title='Protocol test', + content='link', + ) + note.clean() + self.assertNotIn('javascript:', note.content.lower()) + + # ------------------------------------------------------------------------- + # API - script injection (POST) + # ------------------------------------------------------------------------- + + def test_api_script_tag_stripped(self): + """

hello

" + ) + content = response.data['content'] + self.assertNotIn(' tags are stripped.""" + response = self._create_note_with_content("") + self.assertNotIn(' tags are stripped.""" + response = self._create_note_with_content("") + self.assertNotIn('") + self.assertNotIn('onerror', response.data['content'].lower()) + + def test_api_onload_handler_stripped(self): + """Onload attribute is stripped (e.g. on svg tags).""" + response = self._create_note_with_content( + "" + ) + self.assertNotIn('onload', response.data['content'].lower()) + + def test_api_onclick_handler_stripped(self): + """Onclick attribute is stripped from otherwise-allowed tags.""" + response = self._create_note_with_content("

click me

") + self.assertNotIn('onclick', response.data['content'].lower()) + + def test_api_onmouseover_handler_stripped(self): + """Onmouseover attribute is stripped.""" + response = self._create_note_with_content("hover") + self.assertNotIn('onmouseover', response.data['content'].lower()) + + def test_api_onfocus_handler_stripped(self): + """Onfocus attribute on an input element is stripped.""" + response = self._create_note_with_content( + "" + ) + self.assertNotIn('onfocus', response.data['content'].lower()) + + # ------------------------------------------------------------------------- + # API - javascript: / vbscript: protocol injection + # ------------------------------------------------------------------------- + + def test_api_javascript_href_stripped(self): + """javascript: href is removed from anchor tags.""" + response = self._create_note_with_content( + "click" + ) + self.assertNotIn('javascript:', response.data['content'].lower()) + + def test_api_javascript_href_uppercase_stripped(self): + """JAVASCRIPT: href (uppercase) is removed from anchor tags.""" + response = self._create_note_with_content( + "click" + ) + self.assertNotIn('javascript:', response.data['content'].lower()) + + def test_api_vbscript_href_stripped(self): + """vbscript: href is removed from anchor tags.""" + response = self._create_note_with_content( + "click" + ) + self.assertNotIn('vbscript:', response.data['content'].lower()) + + # ------------------------------------------------------------------------- + # API - dangerous tag removal + # ------------------------------------------------------------------------- + + def test_api_iframe_stripped(self): + """" + ) + self.assertNotIn(' tags are stripped entirely.""" + response = self._create_note_with_content("") + self.assertNotIn(' tags are stripped entirely.""" + response = self._create_note_with_content("") + self.assertNotIn(' tags are stripped (prevents base-URL hijacking).""" + response = self._create_note_with_content( + "" + ) + self.assertNotIn(' tags are stripped (prevents external stylesheet injection).""" + response = self._create_note_with_content( + "" + ) + self.assertNotIn(' tags are stripped.""" + response = self._create_note_with_content( + "" + ) + self.assertNotIn(' tags are stripped (prevents CSRF / phishing via injected forms).""" + response = self._create_note_with_content( + "
" + ) + self.assertNotIn('x" + ) + self.assertNotIn('javascript:', response.data['content'].lower()) + + def test_api_style_expression_stripped(self): + """IE-era CSS expression() is stripped from style attributes.""" + response = self._create_note_with_content( + '

x

' + ) + self.assertNotIn('expression(', response.data['content'].lower()) + + # ------------------------------------------------------------------------- + # API - SVG-based XSS + # ------------------------------------------------------------------------- + + def test_api_svg_onload_stripped(self): + """SVG with onload handler is sanitized.""" + response = self._create_note_with_content( + "" + "" + ) + self.assertNotIn('onload', response.data['content'].lower()) + + def test_api_svg_animate_javascript_stripped(self): + """SVG animate element with javascript: href value is stripped.""" + response = self._create_note_with_content( + "" + ) + self.assertNotIn('javascript:', response.data['content'].lower()) + + # ------------------------------------------------------------------------- + # API - data URI injection + # ------------------------------------------------------------------------- + + def test_api_data_uri_in_img_src_stripped(self): + """data: URI in img src containing a script payload is stripped.""" + response = self._create_note_with_content( + '' + ) + content = response.data['content'] + self.assertNotIn('Original safe content

') + pk = note.data['pk'] + + response = self.patch( + self._note_url(pk), + data={'content': "

Updated

"}, + expected_code=200, + ) + content = response.data['content'] + self.assertNotIn('', content) + self.assertIn('', content) + + def test_safe_https_link_preserved(self): + """An anchor with an https:// href is kept after sanitization.""" + response = self._create_note_with_content( + 'documentation' + ) + content = response.data['content'] + self.assertIn('https://example.com', content) + self.assertIn('documentation', content) + + def test_blockquote_preserved(self): + """Block-level formatting elements such as blockquote are preserved.""" + response = self._create_note_with_content( + '

Quoted text

' + ) + content = response.data['content'] + self.assertIn('
', content) + self.assertIn('Quoted text', content) + + def test_empty_content_accepted(self): + """An empty content field is valid and stored as-is.""" + response = self._create_note_with_content('') + self.assertEqual(response.data['content'], '') + + def test_plain_text_content_preserved(self): + """Plain text with no HTML tags is stored without modification.""" + plain = 'Just plain text, no HTML here.' + response = self._create_note_with_content(plain) + self.assertEqual(response.data['content'], plain) + + def test_html_entities_in_plain_text_not_executed(self): + """HTML-entity-encoded script tags in plain text are not executed as markup.""" + # <script> is already-escaped user text — it should be stored + # safely and not interpreted as a tag. + entity_payload = '<script>alert(1)</script>' + response = self._create_note_with_content(entity_payload) + content = response.data['content'] + # Must not contain a live \n\n', + **tree, + ) + + instances = [ + ('part', part), + ('company', company), + ('salesorder', so), + ( + 'manufacturerpart', + ManufacturerPart.objects.create( + part=part, + manufacturer=company, + MPN='MPN-123', + notes='Some **bold** manufacturer part notes', + ), + ), + ( + 'supplierpart', + SupplierPart.objects.create( + part=part, + supplier=company, + SKU='SKU-123', + notes='Some **bold** supplier part notes', + ), + ), + ( + 'build', + Build.objects.create( + part=part, + reference='BO-0001', + title='Test Build', + quantity=10, + notes='Some **bold** build notes', + **tree, + ), + ), + ( + 'stockitem', + StockItem.objects.create( + part=part, quantity=10, notes='Some **bold** stock item notes' + ), + ), + ( + 'purchaseorder', + PurchaseOrder.objects.create( + reference='PO-12345', + supplier=company, + description='Test Purchase Order Description', + notes='Some **bold** purchase order notes', + ), + ), + ( + 'returnorder', + ReturnOrder.objects.create( + reference='RO-12345', + customer=company, + description='Test Return Order Description', + notes='Some **bold** return order notes', + ), + ), + ( + 'salesordershipment', + SalesOrderShipment.objects.create( + order=so, reference='SHIP-001', notes='Some **bold** shipment notes' + ), + ), + ( + 'transferorder', + TransferOrder.objects.create( + reference='TO-12345', + description='Test Transfer Order Description', + notes='Some **bold** transfer order notes', + ), + ), + ] + + # Record the expected (model_type, model_id) values for later comparison + self.expected_notes = [(model, instance.pk) for model, instance in instances] + self.part_pk = part.pk + self.empty_notes_part_pk = empty_notes_part.pk + self.null_notes_part_pk = null_notes_part.pk + self.malicious_notes_part_pk = malicious_notes_part.pk + + def test_notes_migrated(self): + """Test that a Note object has been created for each legacy notes field.""" + Note = self.new_state.apps.get_model('common', 'Note') + ContentType = self.new_state.apps.get_model('contenttypes', 'ContentType') + + # One note per instance with non-empty notes, plus one empty + # placeholder note for the blank-notes part with a linked image, plus + # one note for the malicious-notes part (see test_malicious_notes_sanitized) + self.assertEqual(Note.objects.count(), len(self.expected_notes) + 2) + + for model, pk in self.expected_notes: + content_type = ContentType.objects.get(model=model) + note = Note.objects.get(model_type=content_type, model_id=pk) + + self.assertEqual(note.title, 'Note') + self.assertTrue(note.primary) + self.assertFalse(note.template) + + # Markdown content has been converted to HTML + self.assertIn('bold', note.content) + self.assertNotIn('**', note.content) + + part_content_type = ContentType.objects.get(model='part') + + # The blank-notes part with a directly-linked image gets an empty + # placeholder note, so its image is preserved rather than discarded + placeholder_note = Note.objects.get( + model_type=part_content_type, model_id=self.empty_notes_part_pk + ) + self.assertEqual(placeholder_note.content, '') + self.assertTrue(placeholder_note.primary) + self.assertFalse(placeholder_note.template) + + # The blank-notes part with *no* linked image gets no note at all + self.assertFalse( + Note.objects.filter( + model_type=part_content_type, model_id=self.null_notes_part_pk + ).exists() + ) + + def test_malicious_notes_sanitized(self): + """Test that raw HTML in a legacy notes field is stripped during migration. + + bulk_create() (used to migrate notes in bulk) never calls Note.save()/.clean(), + which is the only place the nh3 sanitizer normally runs - so this exercises the + migration's own sanitize_note_content() call instead. + """ + Note = self.new_state.apps.get_model('common', 'Note') + ContentType = self.new_state.apps.get_model('contenttypes', 'ContentType') + + part_content_type = ContentType.objects.get(model='part') + note = Note.objects.get( + model_type=part_content_type, model_id=self.malicious_notes_part_pk + ) + + self.assertNotIn('' + note.save() + self.assertEqual(note.images.count(), 2) + self.assertTrue(default_storage.exists(name1)) + self.assertTrue(default_storage.exists(name2)) + + # Remove the second image from the content and save + note.content = f'' + note.save() + + # The removed image must be gone from both the DB and the file system + self.assertFalse(NotesImage.objects.filter(pk=ni2.pk).exists()) + self.assertFalse(default_storage.exists(name2)) + + # The retained image must still exist in both the DB and the file system + self.assertTrue(NotesImage.objects.filter(pk=ni1.pk).exists()) + self.assertTrue(default_storage.exists(name1)) + + def test_image_cleanup_on_cascade_delete(self): + """Images are removed from storage when their note is deleted via a cascade. + + InvenTreeNoteMixin.delete() (and Note.delete()'s own cascade to its images) delete + notes/images via Django's deletion Collector, not by calling NotesImage.delete() on + each instance directly - the collector never invokes an overridden Model.delete() + on cascaded objects, only its pre_delete/post_delete signals. This exercises that + path specifically, rather than test_image_cleanup's direct note.save()-driven cleanup. + """ + part = Part.objects.create( + name='Cascade Delete Cleanup Test Part', + description='Part for cascade-delete image-cleanup test', + active=False, # Part.delete() refuses to delete an active part + ) + part_ct = ContentType.objects.get_for_model(Part) + + note = Note( + model_type=part_ct, model_id=part.pk, title='Cascade Test Note', content='' + ) + note.save() + + img_obj = Image.new('RGB', (10, 10), color='red') + with io.BytesIO() as buf: + img_obj.save(buf, format='PNG') + png_bytes = buf.getvalue() + + ni = NotesImage(note=note) + ni.image.save('cascade_cleanup.png', ContentFile(png_bytes)) + image_name = ni.image.name + + self.assertTrue(default_storage.exists(image_name)) + + # Delete the *part*, not the note or image directly - this cascades + # Part -> InvenTreeNoteMixin.delete() -> Note -> NotesImage + part.delete() + + self.assertFalse(NotesImage.objects.filter(pk=ni.pk).exists()) + self.assertFalse(Note.objects.filter(pk=note.pk).exists()) + self.assertFalse(default_storage.exists(image_name)) + + def test_copy_notes_with_images(self): + """Images are duplicated (file + DB record) when copy_notes_from is called. + + Specifically: + - New NotesImage records are created pointing to the new notes + - The image files are physically copied (independent from the source) + - The new note content references the new image URLs, not the old ones + - Deleting the source note does not affect the copied note's images + """ + # Build a minimal valid PNG in memory + img_obj = Image.new('RGB', (10, 10), color='green') + with io.BytesIO() as buf: + img_obj.save(buf, format='PNG') + png_bytes = buf.getvalue() + + part_ct = ContentType.objects.get_for_model(Part) + + src_part = Part.objects.create( + name='Copy Notes Source Part', + description='Source part for copy_notes_from test', + ) + dst_part = Part.objects.create( + name='Copy Notes Dest Part', + description='Destination part for copy_notes_from test', ) - # Check that a new file has been created - self.assertEqual(NotesImage.objects.count(), n + 1) + src_note = Note( + model_type=part_ct, model_id=src_part.pk, title='Src Note', content='' + ) + src_note.save() + + ni = NotesImage(note=src_note) + ni.image.save('copy_test.png', ContentFile(png_bytes)) + old_url = ni.image.url + old_name = ni.image.name + + src_note.content = f'![img]({old_url})' + src_note.save() + + dst_part.copy_notes_from(src_part) + + dst_note = dst_part.notes_list.get(title='Src Note') + + # A new NotesImage must exist for the destination note + self.assertEqual(dst_note.images.count(), 1) + new_img = dst_note.images.first() + + # The file must be a distinct copy + self.assertNotEqual(new_img.image.name, old_name) + self.assertTrue(default_storage.exists(new_img.image.name)) + + # The new note content must reference the new URL, not the old one + self.assertIn(new_img.image.url, dst_note.content) + self.assertNotIn(old_url, dst_note.content) + + # Deleting the source NotesImage must not remove the copied image + # (files are independent; Django cascade does not call Python delete()) + ni.delete() + self.assertFalse(default_storage.exists(old_name)) + self.assertTrue(default_storage.exists(new_img.image.name)) + self.assertTrue(NotesImage.objects.filter(pk=new_img.pk).exists()) + + +class DeleteOldNotesImagesTaskTest(InvenTreeAPITestCase): + """Tests for the delete_old_notes_images scheduled task.""" + + def setUp(self): + """Create a Note to attach images to.""" + super().setUp() + + part = Part.objects.create(name='Notes Image Task Test Part', description='x') + part_ct = ContentType.objects.get_for_model(Part) + self.note = Note.objects.create( + model_type=part_ct, model_id=part.pk, title='N', content='' + ) + + def _generate_image_bytes(self) -> bytes: + buf = io.BytesIO() + Image.new('RGB', (16, 16), color='blue').save(buf, format='PNG') + return buf.getvalue() + + def _create_image( + self, name: str, age_days: int = 0, referenced: bool = False + ) -> NotesImage: + image = NotesImage.objects.create(note=self.note) + image.image.save(name, ContentFile(self._generate_image_bytes())) + + if referenced: + self.note.content = f'' + self.note.save() + + if age_days: + NotesImage.objects.filter(pk=image.pk).update( + date=timezone.now() - timedelta(days=age_days) + ) + + return image + + def test_old_unreferenced_image_is_removed(self): + """An old image no longer referenced by its note's content is removed.""" + image = self._create_image('old_unreferenced.png', age_days=100) + delete_old_notes_images() + self.assertFalse(NotesImage.objects.filter(pk=image.pk).exists()) + + def test_old_referenced_image_is_kept(self): + """An old image still referenced by its note's content is kept.""" + image = self._create_image('old_referenced.png', age_days=100, referenced=True) + delete_old_notes_images() + self.assertTrue(NotesImage.objects.filter(pk=image.pk).exists()) + + def test_recent_unreferenced_image_is_kept(self): + """A recently-uploaded, unreferenced image is kept - not yet old enough.""" + image = self._create_image('recent_unreferenced.png') + delete_old_notes_images() + self.assertTrue(NotesImage.objects.filter(pk=image.pk).exists()) + + def test_missing_file_is_removed_regardless_of_age(self): + """An image whose file no longer exists in storage is removed, even if recent.""" + image = self._create_image('missing_file.png') + default_storage.delete(image.image.name) + delete_old_notes_images() + self.assertFalse(NotesImage.objects.filter(pk=image.pk).exists()) class ProjectCodesTest(InvenTreeAPITestCase): diff --git a/src/backend/InvenTree/common/validators.py b/src/backend/InvenTree/common/validators.py index d1d9e63ebf..f66bce6f1d 100644 --- a/src/backend/InvenTree/common/validators.py +++ b/src/backend/InvenTree/common/validators.py @@ -11,52 +11,89 @@ import common.icons from common.settings import get_global_setting +def models_with_mixin(mixin_class) -> list: + """Return a list of models which inherit from the given mixin class.""" + import InvenTree.helpers_model + + return list(InvenTree.helpers_model.getModelsWithMixin(mixin_class)) + + +def model_options_for_mixin(mixin_class) -> list: + """Return (name, verbose_name) choices for models which inherit from the given mixin class.""" + return [ + (model.__name__.lower(), model._meta.verbose_name) + for model in models_with_mixin(mixin_class) + ] + + +def note_model_types(): + """Return a list of valid note model choices.""" + import InvenTree.models + + return models_with_mixin(InvenTree.models.InvenTreeNoteMixin) + + +def note_model_options(): + """Return a list of options for models which support notes.""" + import InvenTree.models + + return model_options_for_mixin(InvenTree.models.InvenTreeNoteMixin) + + +def validate_note_model_type(value): + """Ensure that the provided content type supports notes. + + Accepts either a ContentType instance, or a raw primary key - Django calls + a ForeignKey's field-level validators with the raw attname value (the + related object's pk), while callers with an actual ContentType instance + in hand (e.g. Note.clean()) can pass it directly. + """ + from django.contrib.contenttypes.models import ContentType + + if not value: + return + + if not isinstance(value, ContentType): + try: + value = ContentType.objects.get(pk=value) + except ContentType.DoesNotExist: + raise ValidationError(_('Invalid content type')) + + if value.model_class() not in note_model_types(): + raise ValidationError(_('Model type does not support notes')) + + def parameter_model_types(): """Return a list of valid parameter model choices.""" import InvenTree.models - return list( - InvenTree.helpers_model.getModelsWithMixin( - InvenTree.models.InvenTreeParameterMixin - ) - ) + return models_with_mixin(InvenTree.models.InvenTreeParameterMixin) def parameter_model_options(): """Return a list of options for models which support parameters.""" - return [ - (model.__name__.lower(), model._meta.verbose_name) - for model in parameter_model_types() - ] + import InvenTree.models + + return model_options_for_mixin(InvenTree.models.InvenTreeParameterMixin) def parameter_template_model_options(): """Return a list of options for models which support parameter templates.""" - options = [ - (model.__name__.lower(), model._meta.verbose_name) - for model in parameter_model_types() - ] - - return [(None, _('All models')), *options] + return [(None, _('All models')), *parameter_model_options()] def attachment_model_types(): """Return a list of valid attachment model choices.""" import InvenTree.models - return list( - InvenTree.helpers_model.getModelsWithMixin( - InvenTree.models.InvenTreeAttachmentMixin - ) - ) + return models_with_mixin(InvenTree.models.InvenTreeAttachmentMixin) def attachment_model_options(): """Return a list of options for models which support attachments.""" - return [ - (model.__name__.lower(), model._meta.verbose_name) - for model in attachment_model_types() - ] + import InvenTree.models + + return model_options_for_mixin(InvenTree.models.InvenTreeAttachmentMixin) def attachment_model_class_from_label(label: str): @@ -93,28 +130,6 @@ def validate_attachment_file(attachment): raise ValidationError(_('Invalid file name')) -def validate_notes_model_type(value): - """Ensure that the provided model type is valid. - - The provided value must map to a model which implements the 'InvenTreeNotesMixin'. - """ - import InvenTree.helpers_model - import InvenTree.models - - if not value: - # Empty values are allowed - return - - model_types = list( - InvenTree.helpers_model.getModelsWithMixin(InvenTree.models.InvenTreeNotesMixin) - ) - - model_names = [model.__name__.lower() for model in model_types] - - if value.lower() not in model_names: - raise ValidationError(f"Invalid model type '{value}'") - - def validate_decimal_places_min(value): """Validator for PRICING_DECIMAL_PLACES_MIN setting.""" try: diff --git a/src/backend/InvenTree/company/migrations/0081_remove_company_notes_remove_manufacturerpart_notes_and_more.py b/src/backend/InvenTree/company/migrations/0081_remove_company_notes_remove_manufacturerpart_notes_and_more.py new file mode 100644 index 0000000000..16d0bffc2a --- /dev/null +++ b/src/backend/InvenTree/company/migrations/0081_remove_company_notes_remove_manufacturerpart_notes_and_more.py @@ -0,0 +1,26 @@ +# Generated by Django 5.2.14 on 2026-05-25 12:36 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("company", "0080_company_tags"), + ("common", "0052_remove_notesimage_model_id_and_more") + ] + + operations = [ + migrations.RemoveField( + model_name="company", + name="notes", + ), + migrations.RemoveField( + model_name="manufacturerpart", + name="notes", + ), + migrations.RemoveField( + model_name="supplierpart", + name="notes", + ), + ] diff --git a/src/backend/InvenTree/company/models.py b/src/backend/InvenTree/company/models.py index 4adfdf7861..93711d9974 100644 --- a/src/backend/InvenTree/company/models.py +++ b/src/backend/InvenTree/company/models.py @@ -78,7 +78,7 @@ class CompanyReportContext(report.mixins.BaseReportContext, TypedDict): class Company( InvenTree.models.InvenTreeAttachmentMixin, InvenTree.models.InvenTreeParameterMixin, - InvenTree.models.InvenTreeNotesMixin, + InvenTree.models.InvenTreeNoteMixin, InvenTree.models.InvenTreeTagsMixin, report.mixins.InvenTreeReportMixin, InvenTree.models.InvenTreeImageMixin, @@ -490,7 +490,7 @@ class ManufacturerPart( InvenTree.models.InvenTreeAttachmentMixin, InvenTree.models.InvenTreeParameterMixin, InvenTree.models.InvenTreeBarcodeMixin, - InvenTree.models.InvenTreeNotesMixin, + InvenTree.models.InvenTreeNoteMixin, InvenTree.models.InvenTreeTagsMixin, InvenTree.models.InvenTreeMetadataModel, ): @@ -606,8 +606,8 @@ class SupplierPart( InvenTree.models.InvenTreeParameterMixin, InvenTree.models.MetadataMixin, InvenTree.models.InvenTreeBarcodeMixin, + InvenTree.models.InvenTreeNoteMixin, InvenTree.models.InvenTreeTagsMixin, - InvenTree.models.InvenTreeNotesMixin, common.models.MetaMixin, InvenTree.models.InvenTreeModel, ): diff --git a/src/backend/InvenTree/company/serializers.py b/src/backend/InvenTree/company/serializers.py index 809f06710f..a0df524770 100644 --- a/src/backend/InvenTree/company/serializers.py +++ b/src/backend/InvenTree/company/serializers.py @@ -23,8 +23,8 @@ from InvenTree.serializers import ( InvenTreeModelSerializer, InvenTreeMoneySerializer, InvenTreeTaggitSerializer, - NotesFieldMixin, OptionalField, + apply_duplicate_copy_options, ) from .models import ( @@ -111,7 +111,6 @@ class CompanySerializer( FilterableSerializerMixin, DataImportExportSerializerMixin, InvenTreeTaggitSerializer, - NotesFieldMixin, InvenTreeModelSerializer, ): """Serializer for Company object (full detail).""" @@ -143,7 +142,6 @@ class CompanySerializer( 'is_customer', 'is_manufacturer', 'is_supplier', - 'notes', 'parts_supplied', 'parts_manufactured', 'primary_address', @@ -196,7 +194,9 @@ class CompanySerializer( parameters = common.filters.enable_parameters_filter() - duplicate = DuplicateOptionsSerializer(Company.objects.all(), copy_parameters=True) + duplicate = DuplicateOptionsSerializer( + Company.objects.all(), copy_parameters=True, copy_notes=True + ) @transaction.atomic def create(self, validated_data): @@ -206,10 +206,13 @@ class CompanySerializer( instance = super().create(validated_data) if duplicate: - original = duplicate['original'] - - if duplicate.get('copy_parameters', True): - instance.copy_parameters_from(original) + apply_duplicate_copy_options( + instance, + duplicate, + duplicate['original'], + copy_notes=True, + copy_parameters=True, + ) return instance @@ -234,7 +237,6 @@ class ManufacturerPartSerializer( FilterableSerializerMixin, DataImportExportSerializerMixin, InvenTreeTaggitSerializer, - NotesFieldMixin, InvenTreeModelSerializer, ): """Serializer for ManufacturerPart object.""" @@ -257,7 +259,6 @@ class ManufacturerPartSerializer( 'MPN', 'link', 'barcode_hash', - 'notes', 'tags', 'parameters', ] @@ -267,7 +268,7 @@ class ManufacturerPartSerializer( parameters = common.filters.enable_parameters_filter() duplicate = DuplicateOptionsSerializer( - ManufacturerPart.objects.all(), copy_parameters=True + ManufacturerPart.objects.all(), copy_parameters=True, copy_notes=True ) @transaction.atomic @@ -278,10 +279,13 @@ class ManufacturerPartSerializer( instance = super().create(validated_data) if duplicate: - original = duplicate['original'] - - if duplicate.get('copy_parameters', True): - instance.copy_parameters_from(original) + apply_duplicate_copy_options( + instance, + duplicate, + duplicate['original'], + copy_notes=True, + copy_parameters=True, + ) return instance @@ -358,7 +362,6 @@ class SupplierPartSerializer( FilterableSerializerMixin, DataImportExportSerializerMixin, InvenTreeTaggitSerializer, - NotesFieldMixin, InvenTreeModelSerializer, ): """Serializer for SupplierPart object.""" @@ -407,7 +410,6 @@ class SupplierPartSerializer( 'supplier', 'supplier_detail', 'updated', - 'notes', 'part_detail', 'tags', 'price_breaks', @@ -542,7 +544,7 @@ class SupplierPartSerializer( updated = serializers.DateTimeField(allow_null=True, read_only=True) duplicate = DuplicateOptionsSerializer( - SupplierPart.objects.all(), copy_parameters=True + SupplierPart.objects.all(), copy_parameters=True, copy_notes=True ) @staticmethod @@ -596,10 +598,13 @@ class SupplierPartSerializer( supplier_part.save(**kwargs) if duplicate: - original = duplicate['original'] - - if duplicate.get('copy_parameters', True): - supplier_part.copy_parameters_from(original) + apply_duplicate_copy_options( + supplier_part, + duplicate, + duplicate['original'], + copy_notes=True, + copy_parameters=True, + ) return supplier_part diff --git a/src/backend/InvenTree/company/test_api.py b/src/backend/InvenTree/company/test_api.py index 7285ac69b9..93dccf80e3 100644 --- a/src/backend/InvenTree/company/test_api.py +++ b/src/backend/InvenTree/company/test_api.py @@ -1,7 +1,9 @@ """Unit testing for the company app API functions.""" +from django.contrib.contenttypes.models import ContentType from django.urls import reverse +from common.models import Note from company.models import ( Address, Company, @@ -15,6 +17,16 @@ from part.models import Part from users.permissions import check_user_permission +def create_note(instance, content='

Some notes

'): + """Helper: attach a Note to a model instance for duplication tests.""" + return Note.objects.create( + model_type=ContentType.objects.get_for_model(type(instance)), + model_id=instance.pk, + title='Original Note', + content=content, + ) + + class CompanyTest(InvenTreeAPITestCase): """Series of tests for the Company DRF API.""" @@ -87,6 +99,43 @@ class CompanyTest(InvenTreeAPITestCase): response = self.get(url, data) self.assertEqual(len(response.data), 2) + def test_company_duplicate_copies_notes(self): + """Test that notes are copied when duplicating a Company via the API. + + CompanySerializer declares its 'duplicate' options with copy_notes=True, + so notes should be copied by default (i.e. without explicitly requesting it). + """ + url = reverse('api-company-list') + + create_note(self.acme) + + response = self.post( + url, + { + 'name': 'ACME Duplicate', + 'description': 'Duplicate of ACME', + 'duplicate': {'original': self.acme.pk}, + }, + expected_code=201, + ) + + duplicate = Company.objects.get(pk=response.data['pk']) + self.assertEqual(duplicate.notes.count(), 1) + self.assertEqual(duplicate.notes.first().content, '

Some notes

') + + # Explicitly disabling copy_notes must not copy any notes + response = self.post( + url, + { + 'name': 'ACME Duplicate No Notes', + 'description': 'Duplicate of ACME without notes', + 'duplicate': {'original': self.acme.pk, 'copy_notes': False}, + }, + expected_code=201, + ) + no_notes_duplicate = Company.objects.get(pk=response.data['pk']) + self.assertEqual(no_notes_duplicate.notes.count(), 0) + def test_company_create(self): """Test that we can create a company via the API!""" url = reverse('api-company-list') @@ -161,55 +210,6 @@ class CompanyTest(InvenTreeAPITestCase): len(self.get(url, data={'active': False}, expected_code=200).data), 1 ) - def test_company_notes(self): - """Test the markdown 'notes' field for the Company model.""" - company = Company.objects.first() - assert company - pk = company.pk - - url = reverse('api-company-detail', kwargs={'pk': pk}) - - # Attempt to inject malicious markdown into the "notes" field - xss = [ - '[Click me](javascript:alert(123))', - '![x](javascript:alert(123))', - '![Uh oh...]("onerror="alert(\'XSS\'))', - ] - - for note in xss: - response = self.patch(url, {'notes': note}, expected_code=400) - - self.assertIn( - 'Data contains prohibited markdown content', str(response.data) - ) - - # Tests with disallowed tags - invalid_tags = [ - '', - 'A disallowed tag!', - ] - - for note in invalid_tags: - response = self.patch(url, {'notes': note}, expected_code=400) - - self.assertIn('Remove HTML tags from this value', str(response.data)) - - # The following markdown is safe, and should be accepted - good = [ - 'This is a **bold** statement', - 'This is a *italic* statement', - 'This is a [link](https://www.google.com)', - 'This is an ![image](https://www.google.com/test.jpg)', - 'This is a `code` block', - 'This text has ~~strikethrough~~ formatting', - 'This text has a raw link - https://www.google.com - and should still pass the test', - ] - - for note in good: - response = self.patch(url, {'notes': note}, expected_code=200) - - self.assertEqual(response.data['notes'], note) - def test_company_parameters(self): """Test for annotation of 'parameters' field in Company API.""" url = reverse('api-company-list') @@ -527,6 +527,48 @@ class ManufacturerTest(InvenTreeAPITestCase): response = self.get(url, data) self.assertEqual(len(response.data), 3) + def test_manufacturer_part_duplicate_copies_notes(self): + """Test that notes are copied when duplicating a ManufacturerPart via the API. + + ManufacturerPartSerializer declares its 'duplicate' options with + copy_notes=True, so notes should be copied by default. + """ + url = reverse('api-manufacturer-part-list') + + original = ManufacturerPart.objects.first() + self.assertIsNotNone(original) + + create_note(original) + + response = self.post( + url, + { + 'part': original.part.pk, + 'manufacturer': original.manufacturer.pk, + 'MPN': 'MPN_DUPLICATE', + 'duplicate': {'original': original.pk}, + }, + expected_code=201, + ) + + duplicate = ManufacturerPart.objects.get(pk=response.data['pk']) + self.assertEqual(duplicate.notes.count(), 1) + self.assertEqual(duplicate.notes.first().content, '

Some notes

') + + # Explicitly disabling copy_notes must not copy any notes + response = self.post( + url, + { + 'part': original.part.pk, + 'manufacturer': original.manufacturer.pk, + 'MPN': 'MPN_DUPLICATE_NO_NOTES', + 'duplicate': {'original': original.pk, 'copy_notes': False}, + }, + expected_code=201, + ) + no_notes_duplicate = ManufacturerPart.objects.get(pk=response.data['pk']) + self.assertEqual(no_notes_duplicate.notes.count(), 0) + def test_supplier_part_create(self): """Test a SupplierPart can be created via the API.""" url = reverse('api-supplier-part-list') @@ -612,6 +654,48 @@ class SupplierPartTest(InvenTreeAPITestCase): response = self.get(url, {'part': pk}, expected_code=200) self.assertEqual(len(response.data), n) + def test_supplier_part_duplicate_copies_notes(self): + """Test that notes are copied when duplicating a SupplierPart via the API. + + SupplierPartSerializer declares its 'duplicate' options with + copy_notes=True, so notes should be copied by default. + """ + url = reverse('api-supplier-part-list') + + original = SupplierPart.objects.first() + self.assertIsNotNone(original) + + create_note(original) + + response = self.post( + url, + { + 'part': original.part.pk, + 'supplier': original.supplier.pk, + 'SKU': 'SKU_DUPLICATE', + 'duplicate': {'original': original.pk}, + }, + expected_code=201, + ) + + duplicate = SupplierPart.objects.get(pk=response.data['pk']) + self.assertEqual(duplicate.notes.count(), 1) + self.assertEqual(duplicate.notes.first().content, '

Some notes

') + + # Explicitly disabling copy_notes must not copy any notes + response = self.post( + url, + { + 'part': original.part.pk, + 'supplier': original.supplier.pk, + 'SKU': 'SKU_DUPLICATE_NO_NOTES', + 'duplicate': {'original': original.pk, 'copy_notes': False}, + }, + expected_code=201, + ) + no_notes_duplicate = SupplierPart.objects.get(pk=response.data['pk']) + self.assertEqual(no_notes_duplicate.notes.count(), 0) + def test_output_options(self): """Test the output options for SupplierPart detail.""" sp = SupplierPart.objects.all().first() diff --git a/src/backend/InvenTree/importer/tests.py b/src/backend/InvenTree/importer/tests.py index cfc354b581..dc96119df7 100644 --- a/src/backend/InvenTree/importer/tests.py +++ b/src/backend/InvenTree/importer/tests.py @@ -45,7 +45,7 @@ class ImporterTest(ImporterMixin, InvenTreeTestCase): session.extract_columns() - self.assertEqual(session.column_mappings.count(), 14) + self.assertEqual(session.column_mappings.count(), 13) # Check some of the field mappings for field, col in [ @@ -518,7 +518,9 @@ class DataImportRowConcurrencyTest(ImporterMixin, TransactionTestCase): # the existing instance value. That's a separate, already-tracked # issue (GH #12499) and would confound this test, which is only # about proving the row lock closes the read/write race. - thread_a = threading.Thread(target=update, args=('notes', 'notes-a')) + thread_a = threading.Thread( + target=update, args=('link', 'https://example.com/a') + ) thread_b = threading.Thread( target=update, args=('packaging', 'packaging-b') ) @@ -531,7 +533,7 @@ class DataImportRowConcurrencyTest(ImporterMixin, TransactionTestCase): self.assertEqual(errors, []) self.item.refresh_from_db() - self.assertEqual(self.item.notes, 'notes-a') + self.assertEqual(self.item.link, 'https://example.com/a') self.assertEqual(self.item.packaging, 'packaging-b') diff --git a/src/backend/InvenTree/order/migrations/0122_remove_purchaseorder_notes_remove_returnorder_notes_and_more.py b/src/backend/InvenTree/order/migrations/0122_remove_purchaseorder_notes_remove_returnorder_notes_and_more.py new file mode 100644 index 0000000000..5e71f4fc08 --- /dev/null +++ b/src/backend/InvenTree/order/migrations/0122_remove_purchaseorder_notes_remove_returnorder_notes_and_more.py @@ -0,0 +1,34 @@ +# Generated by Django 5.2.14 on 2026-05-25 12:36 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("order", "0121_add_line_item_discount"), + ("common", "0052_remove_notesimage_model_id_and_more") + ] + + operations = [ + migrations.RemoveField( + model_name="purchaseorder", + name="notes", + ), + migrations.RemoveField( + model_name="returnorder", + name="notes", + ), + migrations.RemoveField( + model_name="salesorder", + name="notes", + ), + migrations.RemoveField( + model_name="salesordershipment", + name="notes", + ), + migrations.RemoveField( + model_name="transferorder", + name="notes", + ), + ] diff --git a/src/backend/InvenTree/order/models.py b/src/backend/InvenTree/order/models.py index 12fbd889f7..cdbc96daf2 100644 --- a/src/backend/InvenTree/order/models.py +++ b/src/backend/InvenTree/order/models.py @@ -319,7 +319,7 @@ class Order( InvenTree.models.InvenTreeParameterMixin, InvenTree.models.InvenTreeAttachmentMixin, InvenTree.models.InvenTreeBarcodeMixin, - InvenTree.models.InvenTreeNotesMixin, + InvenTree.models.InvenTreeNoteMixin, InvenTree.models.InvenTreeTagsMixin, report.mixins.InvenTreeReportMixin, InvenTree.models.MetadataMixin, @@ -1032,7 +1032,9 @@ class PurchaseOrder(TotalPriceMixin, Order): batch_code: Optional batch code for the item (optional) expiry_date: Optional expiry date for the item (optional) serials: Optional list of serial numbers (optional) - note: Optional notes for the item (optional) + note: Optional note for the item (optional) - recorded against the + item's RECEIVED_AGAINST_PURCHASE_ORDER tracking entry, not the + StockItem itself """ if self.status != PurchaseOrderStatus.PLACED: raise ValidationError( @@ -1042,9 +1044,19 @@ class PurchaseOrder(TotalPriceMixin, Order): # List of stock items which have been created stock_items: list[stock.models.StockItem] = [] + # Per-item 'note' text, index-aligned with stock_items - StockItem no longer + # has its own 'notes' field, so this is threaded through to each item's + # RECEIVED_AGAINST_PURCHASE_ORDER tracking entry instead (see below) + stock_item_notes: list[str] = [] + # List of stock items to bulk create bulk_create_items: list[stock.models.StockItem] = [] + # Notes for bulk_create_items, appended in lockstep - bulk_create_and_fetch() + # re-fetches fresh instances from the database, so any note has to be tracked + # positionally here rather than stashed on the (discarded) unsaved instance + bulk_create_notes: list[str] = [] + # List of tracking entries to create tracking_entries: list[stock.models.StockItemTracking] = [] @@ -1096,6 +1108,7 @@ class PurchaseOrder(TotalPriceMixin, Order): quantity = item['quantity'] barcode = item.get('barcode', '') + note = item.get('note') or item.get('notes') or '' try: if quantity < 0: @@ -1170,7 +1183,6 @@ class PurchaseOrder(TotalPriceMixin, Order): 'quantity': 1 if serialize else stock_quantity, 'batch': item.get('batch_code', ''), 'expiry_date': item.get('expiry_date', None), - 'notes': item.get('note', '') or item.get('notes', ''), 'packaging': item.get('packaging') or supplier_part.packaging, } @@ -1229,9 +1241,12 @@ class PurchaseOrder(TotalPriceMixin, Order): ) # run validation for serialized items plugin.validate_batch_code new_item.validate_batch_code() + # run validation for serialized items plugin.validate_model_instance new_item.run_plugin_validation() + stock_items.append(new_item) + stock_item_notes.append(note) else: new_item = stock.models.StockItem(**stock_data, serial='', parent=None) @@ -1242,6 +1257,7 @@ class PurchaseOrder(TotalPriceMixin, Order): new_item.assign_barcode(barcode_data=barcode, save=False) bulk_create_items.append(new_item) + bulk_create_notes.append(note) # Bulk create new stock items if len(bulk_create_items) > 0: @@ -1258,9 +1274,10 @@ class PurchaseOrder(TotalPriceMixin, Order): ) stock_items.extend(new_items) + stock_item_notes.extend(bulk_create_notes) # Generate a new tracking entry for each stock item - for item in stock_items: + for item, item_note in zip(stock_items, stock_item_notes, strict=True): tracking_entries.append( item.add_tracking_entry( StockHistoryCode.RECEIVED_AGAINST_PURCHASE_ORDER, @@ -1270,6 +1287,7 @@ class PurchaseOrder(TotalPriceMixin, Order): 'purchaseorder': self.pk, 'quantity': float(item.quantity), }, + notes=item_note, commit=False, ) ) @@ -1327,7 +1345,8 @@ class PurchaseOrder(TotalPriceMixin, Order): Keyword Arguments: batch_code: Optional batch code for the new StockItem serials: Optional list of serial numbers to assign to the new StockItem(s) - notes: Optional notes field for the StockItem + note: Optional note, recorded against the item's tracking entry (not the + StockItem itself) packaging: Optional packaging field for the StockItem barcode: Optional barcode field for the StockItem notify: If true, notify users of received items @@ -2599,8 +2618,8 @@ class SalesOrderShipment( InvenTree.models.InvenTreeParameterMixin, InvenTree.models.InvenTreeAttachmentMixin, InvenTree.models.InvenTreeBarcodeMixin, + InvenTree.models.InvenTreeNoteMixin, InvenTree.models.InvenTreeTagsMixin, - InvenTree.models.InvenTreeNotesMixin, report.mixins.InvenTreeReportMixin, InvenTree.models.MetadataMixin, InvenTree.models.InvenTreeModel, @@ -2617,7 +2636,6 @@ class SalesOrderShipment( shipment_date: Date this shipment was "shipped" (or null) checked_by: User reference field indicating who checked this order reference: Custom reference text for this shipment (e.g. consignment number?) - notes: Custom notes field for this shipment """ @classmethod diff --git a/src/backend/InvenTree/order/serializers.py b/src/backend/InvenTree/order/serializers.py index c7a9c944c4..d4fa0c81fd 100644 --- a/src/backend/InvenTree/order/serializers.py +++ b/src/backend/InvenTree/order/serializers.py @@ -40,8 +40,8 @@ from InvenTree.serializers import ( InvenTreeModelSerializer, InvenTreeMoneySerializer, InvenTreeTaggitSerializer, - NotesFieldMixin, OptionalField, + apply_duplicate_copy_options, ) from InvenTree.tasks import batch_offload_tasks from order.status_codes import ( @@ -82,7 +82,6 @@ class AbstractOrderSerializer( """Abstract serializer class which provides fields common to all order types.""" export_exclude_fields = ['notes'] - import_exclude_fields = ['notes'] # Number of line items in this order @@ -229,7 +228,6 @@ class AbstractOrderSerializer( 'status', 'status_text', 'status_custom_key', - 'notes', 'barcode_hash', 'overdue', 'duplicate', @@ -273,8 +271,9 @@ class AbstractOrderSerializer( line.order = instance line.save() - if duplicate.get('copy_parameters', False): - instance.copy_parameters_from(original) + apply_duplicate_copy_options( + instance, duplicate, original, copy_notes=False, copy_parameters=False + ) return instance @@ -382,7 +381,6 @@ class AbstractExtraLineMeta: @register_importer() class PurchaseOrderSerializer( - NotesFieldMixin, TotalPriceMixin, InvenTreeCustomStatusSerializerMixin, AbstractOrderSerializer, @@ -427,6 +425,7 @@ class PurchaseOrderSerializer( copy_lines=True, copy_extra_lines=True, copy_parameters=True, + copy_notes=True, ) @staticmethod @@ -1112,7 +1111,6 @@ class PurchaseOrderReceiveSerializer(serializers.Serializer): @register_importer() class SalesOrderSerializer( - NotesFieldMixin, TotalPriceMixin, InvenTreeCustomStatusSerializerMixin, AbstractOrderSerializer, @@ -1152,6 +1150,7 @@ class SalesOrderSerializer( copy_lines=True, copy_extra_lines=True, copy_parameters=True, + copy_notes=True, ) @staticmethod @@ -1427,7 +1426,6 @@ class SalesOrderShipmentSerializer( DataImportExportSerializerMixin, FilterableSerializerMixin, InvenTreeTaggitSerializer, - NotesFieldMixin, InvenTreeModelSerializer, ): """Serializer for the SalesOrderShipment class.""" @@ -1452,7 +1450,6 @@ class SalesOrderShipmentSerializer( 'invoice_number', 'barcode_hash', 'link', - 'notes', # Extra detail fields 'parameters', 'checked_by_detail', @@ -1532,7 +1529,9 @@ class SalesOrderShipmentSerializer( tags = common.filters.enable_tags_filter() duplicate = DuplicateOptionsSerializer( - order.models.SalesOrderShipment.objects.all(), copy_parameters=True + order.models.SalesOrderShipment.objects.all(), + copy_parameters=True, + copy_notes=True, ) @transaction.atomic @@ -1543,10 +1542,13 @@ class SalesOrderShipmentSerializer( instance = super().create(validated_data) if duplicate: - original = duplicate['original'] - - if duplicate.get('copy_parameters', True): - instance.copy_parameters_from(original) + apply_duplicate_copy_options( + instance, + duplicate, + duplicate['original'], + copy_notes=True, + copy_parameters=True, + ) return instance @@ -2141,7 +2143,6 @@ class SalesOrderExtraLineSerializer( @register_importer() class ReturnOrderSerializer( - NotesFieldMixin, InvenTreeCustomStatusSerializerMixin, AbstractOrderSerializer, TotalPriceMixin, @@ -2176,6 +2177,7 @@ class ReturnOrderSerializer( order.models.ReturnOrder.objects.all(), copy_extra_lines=True, copy_parameters=True, + copy_notes=True, ) @staticmethod @@ -2438,7 +2440,6 @@ class ReturnOrderExtraLineSerializer( @register_importer() class TransferOrderSerializer( - NotesFieldMixin, InvenTreeCustomStatusSerializerMixin, AbstractOrderSerializer, InvenTreeModelSerializer, @@ -2468,7 +2469,10 @@ class TransferOrderSerializer( # Note: TransferOrder does not have "extra" line items duplicate = DuplicateOptionsSerializer( - order.models.TransferOrder.objects.all(), copy_lines=True, copy_parameters=True + order.models.TransferOrder.objects.all(), + copy_lines=True, + copy_parameters=True, + copy_notes=True, ) @staticmethod diff --git a/src/backend/InvenTree/order/test_api.py b/src/backend/InvenTree/order/test_api.py index 3f8d2e49e7..bcb47df50f 100644 --- a/src/backend/InvenTree/order/test_api.py +++ b/src/backend/InvenTree/order/test_api.py @@ -632,6 +632,58 @@ class PurchaseOrderTest(OrderTest): self.assertEqual(po_dup.extra_lines.count(), po.extra_lines.count()) self.assertEqual(po_dup.lines.count(), 0) + def test_po_duplicate_copies_notes(self): + """Test that notes are copied when duplicating a PurchaseOrder via the API. + + PurchaseOrderSerializer declares its 'duplicate' options with + copy_notes=True, so notes should be copied by default (i.e. without + explicitly requesting it). + """ + from common.models import Note + + self.assignRole('purchase_order.add') + + po = models.PurchaseOrder.objects.get(pk=1) + + Note.objects.create( + model_type=ContentType.objects.get_for_model(models.PurchaseOrder), + model_id=po.pk, + title='Original Note', + content='

Some purchase order notes

', + ) + + response = self.post( + reverse('api-po-list'), + { + 'supplier': po.supplier.pk, + 'reference': 'PO-9997', + 'description': po.description, + 'duplicate': {'original': po.pk}, + }, + expected_code=201, + ) + + po_dup = models.PurchaseOrder.objects.get(pk=response.data['pk']) + self.assertEqual(po_dup.notes.count(), 1) + self.assertEqual( + po_dup.notes.first().content, '

Some purchase order notes

' + ) + + # Explicitly disabling copy_notes must not copy any notes + response = self.post( + reverse('api-po-list'), + { + 'supplier': po.supplier.pk, + 'reference': 'PO-9996', + 'description': po.description, + 'duplicate': {'original': po.pk, 'copy_notes': False}, + }, + expected_code=201, + ) + + po_no_notes = models.PurchaseOrder.objects.get(pk=response.data['pk']) + self.assertEqual(po_no_notes.notes.count(), 0) + def test_po_cancel(self): """Test the PurchaseOrderCancel API endpoint.""" po = models.PurchaseOrder.objects.get(pk=1) @@ -1605,6 +1657,66 @@ class PurchaseOrderReceiveTest(OrderTest): line.refresh_from_db() self.assertEqual(line.received, line.quantity) + def test_receive_note_recorded_on_tracking_entry(self): + """Test that a per-item 'note' is recorded on the tracking entry, not the StockItem. + + StockItem no longer has its own 'notes' field - the note supplied when + receiving an item is expected to land on that item's + RECEIVED_AGAINST_PURCHASE_ORDER tracking entry instead. + """ + response = self.post( + self.url, + { + 'items': [ + { + 'line_item': 1, + 'quantity': 50, + 'note': 'Damaged box, 2 units short', + } + ], + 'location': 1, + }, + expected_code=201, + ).data + + stock_item = StockItem.objects.get(pk=response[0]['pk']) + + self.assertEqual(stock_item.tracking_info.count(), 1) + entry = stock_item.tracking_info.first() + self.assertEqual( + entry.tracking_type, StockHistoryCode.RECEIVED_AGAINST_PURCHASE_ORDER + ) + self.assertEqual(entry.notes, 'Damaged box, 2 units short') + + def test_receive_note_recorded_on_tracking_entry_serialized(self): + """Test that a per-item 'note' reaches the tracking entry for serialized items too. + + Serialized items are created via a different code path to non-serialized + ones (StockItem._create_serial_numbers(), rather than a bulk_create()), so + this is tested separately. + """ + self.post( + self.url, + { + 'items': [ + { + 'line_item': 1, + 'quantity': 3, + 'serial_numbers': '200+', + 'note': 'Received via serialized batch', + } + ], + 'location': 1, + }, + expected_code=201, + ) + + for i in range(200, 203): + item = StockItem.objects.get(serial_int=i) + self.assertEqual(item.tracking_info.count(), 1) + entry = item.tracking_info.first() + self.assertEqual(entry.notes, 'Received via serialized batch') + def test_bulk_receive_query_benchmark(self): """Benchmark: measure the number of DB queries required to receive 100 line items at once.""" InvenTreeSetting.set_setting('ENABLE_PLUGINS_EVENTS', True, change_user=None) @@ -2036,6 +2148,58 @@ class SalesOrderTest(OrderTest): self.assertEqual(duplicate_so.customer, so.customer) self.assertEqual(duplicate_so.parameters.count(), 5) + def test_so_duplicate_copies_notes(self): + """Test that notes are copied when duplicating a SalesOrder via the API. + + SalesOrderSerializer declares its 'duplicate' options with + copy_notes=True, so notes should be copied by default (i.e. without + explicitly requesting it). + """ + from common.models import Note + + url = reverse('api-so-list') + + self.assignRole('sales_order.add') + + so = models.SalesOrder.objects.get(pk=1) + + Note.objects.create( + model_type=ContentType.objects.get_for_model(models.SalesOrder), + model_id=so.pk, + title='Original Note', + content='

Some sales order notes

', + ) + + response = self.post( + url, + { + 'reference': 'SO-12347', + 'customer': so.customer.pk, + 'duplicate': {'original': so.pk}, + }, + expected_code=201, + ) + + duplicate_so = models.SalesOrder.objects.get(pk=response.data['pk']) + self.assertEqual(duplicate_so.notes.count(), 1) + self.assertEqual( + duplicate_so.notes.first().content, '

Some sales order notes

' + ) + + # Explicitly disabling copy_notes must not copy any notes + response = self.post( + url, + { + 'reference': 'SO-12348', + 'customer': so.customer.pk, + 'duplicate': {'original': so.pk, 'copy_notes': False}, + }, + expected_code=201, + ) + + no_notes_so = models.SalesOrder.objects.get(pk=response.data['pk']) + self.assertEqual(no_notes_so.notes.count(), 0) + def test_so_cancel(self): """Test API endpoint for cancelling a SalesOrder.""" so = models.SalesOrder.objects.get(pk=1) @@ -2906,6 +3070,54 @@ class SalesOrderAllocateTest(OrderTest): len(response.data), count_before + 3 * models.SalesOrder.objects.count() ) + def test_shipment_duplicate_copies_notes(self): + """Test that notes are copied when duplicating a SalesOrderShipment via the API. + + SalesOrderShipmentSerializer declares its 'duplicate' options with + copy_notes=True, so notes should be copied by default (i.e. without + explicitly requesting it). + """ + from common.models import Note + + url = reverse('api-so-shipment-list') + + Note.objects.create( + model_type=ContentType.objects.get_for_model(models.SalesOrderShipment), + model_id=self.shipment.pk, + title='Original Note', + content='

Some shipment notes

', + ) + + response = self.post( + url, + { + 'order': self.order.pk, + 'reference': 'SH-DUP', + 'duplicate': {'original': self.shipment.pk}, + }, + expected_code=201, + ) + + duplicate = models.SalesOrderShipment.objects.get(pk=response.data['pk']) + self.assertEqual(duplicate.notes.count(), 1) + self.assertEqual(duplicate.notes.first().content, '

Some shipment notes

') + + # Explicitly disabling copy_notes must not copy any notes + response = self.post( + url, + { + 'order': self.order.pk, + 'reference': 'SH-DUP-NO-NOTES', + 'duplicate': {'original': self.shipment.pk, 'copy_notes': False}, + }, + expected_code=201, + ) + + no_notes_duplicate = models.SalesOrderShipment.objects.get( + pk=response.data['pk'] + ) + self.assertEqual(no_notes_duplicate.notes.count(), 0) + def test_output_options(self): """Test the various output options for the SalesOrderAllocation detail endpoint.""" self.run_output_test( diff --git a/src/backend/InvenTree/part/fixtures/part.yaml b/src/backend/InvenTree/part/fixtures/part.yaml index 58023cf7ad..692757857e 100644 --- a/src/backend/InvenTree/part/fixtures/part.yaml +++ b/src/backend/InvenTree/part/fixtures/part.yaml @@ -104,7 +104,6 @@ fields: name: 'Bob' description: 'Can we build it? Yes we can!' - notes: 'Some notes associated with this part' assembly: true salable: true purchaseable: false diff --git a/src/backend/InvenTree/part/migrations/0154_remove_part_notes.py b/src/backend/InvenTree/part/migrations/0154_remove_part_notes.py new file mode 100644 index 0000000000..3039e975e0 --- /dev/null +++ b/src/backend/InvenTree/part/migrations/0154_remove_part_notes.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.14 on 2026-05-25 12:36 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("part", "0153_bomitem_piece_count_bomitem_piece_size"), + ("common", "0052_remove_notesimage_model_id_and_more") + ] + + operations = [ + migrations.RemoveField( + model_name="part", + name="notes", + ), + ] diff --git a/src/backend/InvenTree/part/models.py b/src/backend/InvenTree/part/models.py index ec28a8827e..0f713451a7 100644 --- a/src/backend/InvenTree/part/models.py +++ b/src/backend/InvenTree/part/models.py @@ -467,8 +467,8 @@ class Part( InvenTree.models.InvenTreeParameterMixin, InvenTree.models.InvenTreeAttachmentMixin, InvenTree.models.InvenTreeBarcodeMixin, + InvenTree.models.InvenTreeNoteMixin, InvenTree.models.InvenTreeTagsMixin, - InvenTree.models.InvenTreeNotesMixin, report.mixins.InvenTreeReportMixin, InvenTree.models.InvenTreeImageMixin, InvenTree.models.MetadataMixin, diff --git a/src/backend/InvenTree/part/serializers.py b/src/backend/InvenTree/part/serializers.py index 2a14c73368..8aa8badc38 100644 --- a/src/backend/InvenTree/part/serializers.py +++ b/src/backend/InvenTree/part/serializers.py @@ -535,7 +535,6 @@ class DefaultLocationSerializer(InvenTree.serializers.InvenTreeModelSerializer): class PartSerializer( InvenTree.serializers.FilterableSerializerMixin, DataImportExportSerializerMixin, - InvenTree.serializers.NotesFieldMixin, InvenTree.serializers.InvenTreeTaggitSerializer, InvenTree.serializers.InvenTreeModelSerializer, ): @@ -577,7 +576,6 @@ class PartSerializer( 'minimum_stock', 'maximum_stock', 'name', - 'notes', 'parameters', 'pk', 'purchaseable', @@ -1053,17 +1051,14 @@ class PartSerializer( if duplicate.get('copy_bom', False): instance.copy_bom_from(original) - if duplicate.get('copy_notes', False): - instance.notes = original.notes - instance.save() + InvenTree.serializers.apply_duplicate_copy_options( + instance, duplicate, original, copy_notes=False, copy_parameters=False + ) if duplicate.get('copy_image', False): instance.image = original.image instance.save() - if duplicate.get('copy_parameters', False): - instance.copy_parameters_from(original) - if duplicate.get('copy_tests', False): instance.copy_tests_from(original) diff --git a/src/backend/InvenTree/part/test_api.py b/src/backend/InvenTree/part/test_api.py index 837bd68086..c65577ec80 100644 --- a/src/backend/InvenTree/part/test_api.py +++ b/src/backend/InvenTree/part/test_api.py @@ -5,6 +5,7 @@ from datetime import datetime from decimal import Decimal from random import randint +from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError from django.db import connection from django.test.utils import CaptureQueriesContext, override_settings @@ -18,7 +19,7 @@ import build.models import company.models import order.models from build.status_codes import BuildStatus -from common.models import InvenTreeSetting, ParameterTemplate +from common.models import InvenTreeSetting, Note, ParameterTemplate from common.settings import set_global_setting from company.models import Company, SupplierPart from InvenTree.config import get_testfolder_dir @@ -1436,23 +1437,6 @@ class PartAPITest(PartAPITestBase): date = datetime.fromisoformat(item['creation_date']) self.assertGreaterEqual(date, date_compare) - def test_part_notes(self): - """Test the 'notes' field.""" - # First test the 'LIST' endpoint - no notes information provided - url = reverse('api-part-list') - - response = self.get(url, {'limit': 1}, expected_code=200) - data = response.data['results'][0] - - self.assertNotIn('notes', data) - - # Second, test the 'DETAIL' endpoint - notes information provided - url = reverse('api-part-detail', kwargs={'pk': data['pk']}) - - response = self.get(url, expected_code=200) - - self.assertIn('notes', response.data) - def test_output_options(self): """Test the output options for PartList list.""" self.run_output_test( @@ -1668,40 +1652,6 @@ class PartCreationTests(PartAPITestBase): response = self.post(url, data, expected_code=400) self.assertIn('non_field_errors', response.data) - def test_notes_on_create(self): - """Test that notes can be set when creating a Part.""" - list_url = reverse('api-part-list') - - notes = """ - ### Created from importer - - Notes should persist during part creation. - """ - expected_notes = notes.strip() - - response = self.post( - list_url, - { - 'name': 'part with notes', - 'description': 'Part notes are created in the same request', - 'category': 1, - 'notes': notes, - }, - expected_code=201, - ) - - self.assertEqual(response.data['notes'], expected_notes) - - part = Part.objects.get(pk=response.data['pk']) - self.assertEqual(part.notes, expected_notes) - - detail_url = reverse('api-part-detail', kwargs={'pk': part.pk}) - response = self.get(detail_url, expected_code=200) - self.assertEqual(response.data['notes'], expected_notes) - - response = self.get(list_url, {'limit': 1}, expected_code=200) - self.assertNotIn('notes', response.data['results'][0]) - def test_initial_stock(self): """Tests for initial stock quantity creation.""" @@ -1846,6 +1796,14 @@ class PartCreationTests(PartAPITestBase): description=f'Test template {key} for duplication', ) + # Attach a note to the base part + Note.objects.create( + model_type=ContentType.objects.get_for_model(Part), + model_id=base_part.pk, + title='Duplication test note', + content='Some note content', + ) + for do_copy in [True, False]: response = self.post( reverse('api-part-list'), @@ -1871,7 +1829,7 @@ class PartCreationTests(PartAPITestBase): # Check new part self.assertEqual(part.bom_items.count(), 4 if do_copy else 0) - self.assertEqual(part.notes, base_part.notes if do_copy else None) + self.assertEqual(part.notes.count(), 1 if do_copy else 0) self.assertEqual(part.parameters.count(), 2 if do_copy else 0) self.assertEqual(part.test_templates.count(), 3 if do_copy else 0) @@ -2441,20 +2399,33 @@ class PartNotesTests(InvenTreeAPITestCase): roles = ['part.change', 'part.add'] def test_long_notes(self): - """Test that very long notes field is rejected.""" - # Ensure that we cannot upload a very long piece of text - url = reverse('api-part-detail', kwargs={'pk': 1}) + """Test that a very long note content field is rejected. - response = self.patch(url, {'notes': 'abcde' * 10001}, expected_code=400) + Notes are no longer stored directly on the Part model - they are stored + as generic 'Note' instances, linked via a generic foreign key. + """ + # Ensure that we cannot upload a very long piece of text + url = reverse('api-note-list') + + response = self.post( + url, + { + 'model_type': 'part', + 'model_id': 1, + 'title': 'Test Note', + 'content': 'abcde' * 10001, + }, + expected_code=400, + ) self.assertIn( 'Ensure this field has no more than 50000 characters', - str(response.data['notes']), + str(response.data['content']), ) def test_multiline_formatting(self): - """Ensure that markdown formatting is retained.""" - url = reverse('api-part-detail', kwargs={'pk': 1}) + """Ensure that markdown formatting is retained in a note's content.""" + url = reverse('api-note-list') notes = """ ### Title @@ -2467,13 +2438,22 @@ class PartNotesTests(InvenTreeAPITestCase): """ - response = self.patch(url, {'notes': notes}, expected_code=200) + response = self.post( + url, + { + 'model_type': 'part', + 'model_id': 1, + 'title': 'Test Note', + 'content': notes, + }, + expected_code=201, + ) # Ensure that newline chars have not been removed - self.assertIn('\n', response.data['notes']) + self.assertIn('\n', response.data['content']) - # Entire notes field should match original value - self.assertEqual(response.data['notes'], notes.strip()) + # Entire note content should match original value + self.assertEqual(response.data['content'], notes.strip()) class PartPricingDetailTests(InvenTreeAPITestCase): diff --git a/src/backend/InvenTree/report/templates/report/inventree_build_order_report.html b/src/backend/InvenTree/report/templates/report/inventree_build_order_report.html index dfb177a9fa..17ec991e6b 100644 --- a/src/backend/InvenTree/report/templates/report/inventree_build_order_report.html +++ b/src/backend/InvenTree/report/templates/report/inventree_build_order_report.html @@ -4,7 +4,6 @@ {% load report %} {% load barcode %} {% load inventree_extras %} -{% load markdownify %} {% block page_margin %} margin: 2cm; @@ -171,8 +170,9 @@ content: "v{{ report_revision }} - {% format_date date %}";

{% trans "Notes" %}

-{% if build.notes %} -{{ build.notes|markdownify }} +{% note build as build_notes_content %} +{% if build_notes_content %} +{{ build_notes_content }} {% endif %} {% endblock page_content %} diff --git a/src/backend/InvenTree/report/templates/report/inventree_order_report_base.html b/src/backend/InvenTree/report/templates/report/inventree_order_report_base.html index f099b8425d..c9f51c2a67 100644 --- a/src/backend/InvenTree/report/templates/report/inventree_order_report_base.html +++ b/src/backend/InvenTree/report/templates/report/inventree_order_report_base.html @@ -4,7 +4,6 @@ {% load report %} {% load barcode %} {% load inventree_extras %} -{% load markdownify %} {% block page_margin %} margin: 2cm; diff --git a/src/backend/InvenTree/report/templates/report/inventree_purchase_order_report.html b/src/backend/InvenTree/report/templates/report/inventree_purchase_order_report.html index 732925e3e7..a28460b4d1 100644 --- a/src/backend/InvenTree/report/templates/report/inventree_purchase_order_report.html +++ b/src/backend/InvenTree/report/templates/report/inventree_purchase_order_report.html @@ -4,7 +4,6 @@ {% load report %} {% load barcode %} {% load inventree_extras %} -{% load markdownify %} {% block header_content %} diff --git a/src/backend/InvenTree/report/templates/report/inventree_return_order_report.html b/src/backend/InvenTree/report/templates/report/inventree_return_order_report.html index 0dbc062e71..32d5b27f3d 100644 --- a/src/backend/InvenTree/report/templates/report/inventree_return_order_report.html +++ b/src/backend/InvenTree/report/templates/report/inventree_return_order_report.html @@ -4,7 +4,6 @@ {% load report %} {% load barcode %} {% load inventree_extras %} -{% load markdownify %} {% block header_content %} diff --git a/src/backend/InvenTree/report/templates/report/inventree_sales_order_report.html b/src/backend/InvenTree/report/templates/report/inventree_sales_order_report.html index a5f4a75750..013ae76422 100644 --- a/src/backend/InvenTree/report/templates/report/inventree_sales_order_report.html +++ b/src/backend/InvenTree/report/templates/report/inventree_sales_order_report.html @@ -4,7 +4,6 @@ {% load report %} {% load barcode %} {% load inventree_extras %} -{% load markdownify %} {% block header_content %} diff --git a/src/backend/InvenTree/report/templates/report/inventree_sales_order_shipment_report.html b/src/backend/InvenTree/report/templates/report/inventree_sales_order_shipment_report.html index 98aab3e4ed..a2a4fdb747 100644 --- a/src/backend/InvenTree/report/templates/report/inventree_sales_order_shipment_report.html +++ b/src/backend/InvenTree/report/templates/report/inventree_sales_order_shipment_report.html @@ -4,7 +4,6 @@ {% load report %} {% load barcode %} {% load inventree_extras %} -{% load markdownify %} {% block header_content %} diff --git a/src/backend/InvenTree/report/templates/report/inventree_stock_location_report.html b/src/backend/InvenTree/report/templates/report/inventree_stock_location_report.html index f2e13ff843..db1906ef17 100644 --- a/src/backend/InvenTree/report/templates/report/inventree_stock_location_report.html +++ b/src/backend/InvenTree/report/templates/report/inventree_stock_location_report.html @@ -115,7 +115,7 @@ table td.expand { {{ line.part.IPN }} {% decimal line.quantity %} - {{ line.notes }} + {% note line %} {% endfor %} diff --git a/src/backend/InvenTree/report/templates/report/inventree_transfer_order_report.html b/src/backend/InvenTree/report/templates/report/inventree_transfer_order_report.html index 1b88d0275f..5b008493d1 100644 --- a/src/backend/InvenTree/report/templates/report/inventree_transfer_order_report.html +++ b/src/backend/InvenTree/report/templates/report/inventree_transfer_order_report.html @@ -4,7 +4,6 @@ {% load report %} {% load barcode %} {% load inventree_extras %} -{% load markdownify %} {% block header_content %} diff --git a/src/backend/InvenTree/report/templatetags/report.py b/src/backend/InvenTree/report/templatetags/report.py index 591eae7a33..e43edbc222 100644 --- a/src/backend/InvenTree/report/templatetags/report.py +++ b/src/backend/InvenTree/report/templatetags/report.py @@ -21,6 +21,7 @@ from django.utils import translation from django.utils.safestring import SafeString, mark_safe from django.utils.translation import gettext_lazy as _ +import lxml.html from babel import Locale from babel.core import UnknownLocaleError from babel.dates import format_date as babel_format_date @@ -503,6 +504,94 @@ def part_image(part: Part, preview: bool = False, thumbnail: bool = False, **kwa ) +@register.simple_tag() +def note_instance( + instance: Model, title: Optional[str] = None +) -> Optional[common.models.Note]: + """Return a Note object for the given instance and note name. + + Arguments: + instance: A Model object + title: The title of the note to retrieve (case insensitive) + + Returns: + A Note object, or None if not found + + Note: If the 'title' argument is not provided, the first Note object associated with the instance will be returned (if any). + """ + if not instance: + raise ValueError('notes tag requires a valid Model instance') + + if not hasattr(instance, 'notes'): + raise TypeError("notes tag requires a Model with a 'notes' attribute") + + notes = instance.notes + + if title: + # First try with exact match + if note := notes.filter(title=title).first(): + return note + + # Next, try with case-insensitive match + if note := notes.filter(title__iexact=title).first(): + return note + + # If no title is provided, or if no matching note is found, return the first note (if any) + return notes.order_by('-primary').first() + + +@register.simple_tag() +def note(instance: Model, title: Optional[str] = None) -> str: + """Return the HTML content of a Note object for the given instance and note name. + + Arguments: + instance: A Model object + title: The title of the note to retrieve (case insensitive) + + Returns: + The HTML content of the Note, or an empty string if not found + + Note: If the 'title' argument is not provided, the first Note object associated with the instance will be returned (if any). + """ + note = note_instance(instance, title) + + if not note or not note.content: + return '' + + content = note.content + media_prefix = settings.MEDIA_URL + + # Replace any embedded image references with the actual image data + root = lxml.html.fragment_fromstring(content, create_parent='div') + + for img in root.iter('img'): + src = img.get('src') + if not src: + continue + + if not src.startswith(media_prefix): + continue + + img_src = src[len(media_prefix) :] + + # Extract img size attributes + img_data = uploaded_image( + img_src, + replace_missing=True, + width=img.get('width', None), + height=img.get('height', None), + ) + + # Replace the src attribute + img.set('src', img_data) + + content = lxml.html.tostring(root, encoding='unicode') + # fragment_fromstring wraps in a
— strip it back off + content = content.removeprefix('
').removesuffix('
') + + return mark_safe(content) + + @register.simple_tag() def parameter( instance: Model, parameter_name: str diff --git a/src/backend/InvenTree/report/tests.py b/src/backend/InvenTree/report/tests.py index 3d4f558ea4..dc7da1f84b 100644 --- a/src/backend/InvenTree/report/tests.py +++ b/src/backend/InvenTree/report/tests.py @@ -9,17 +9,20 @@ from unittest.mock import patch from django.apps import apps from django.conf import settings +from django.contrib.contenttypes.models import ContentType from django.core.cache import cache from django.core.files.base import ContentFile from django.core.files.storage import default_storage +from django.template.loader import render_to_string from django.test import TestCase from django.urls import reverse +from django.utils.timezone import now from pypdf import PdfReader import report.models as report_models from build.models import Build -from common.models import Attachment +from common.models import Attachment, Note from common.settings import set_global_setting from InvenTree.config import get_base_dir from InvenTree.unit_test import AdminTestCase, InvenTreeAPITestCase @@ -27,7 +30,7 @@ from order.models import PurchaseOrder, ReturnOrder, SalesOrder from part.models import Part from plugin.registry import registry from report.models import LabelTemplate, ReportTemplate -from stock.models import StockItem +from stock.models import StockItem, StockLocation class ReportTest(InvenTreeAPITestCase): @@ -309,6 +312,74 @@ class ReportTest(InvenTreeAPITestCase): self.assertIsNotNone(output.output) self.assertTrue(output.output.name.endswith('.pdf')) + def test_print_build_order(self): + """Test that the built-in Build Order report renders correctly. + + Regression test: this report renders a build's notes via the '{% note %}' + tag - Build.notes is now a QuerySet (via InvenTreeNoteMixin), not text, so + the old '{{ build.notes|markdownify }}' would error out during rendering. + """ + template = ReportTemplate.objects.filter( + enabled=True, model_type='build' + ).first() + assert template + + build = Build.objects.first() + assert build + + Note.objects.create( + model_type=ContentType.objects.get_for_model(Build), + model_id=build.pk, + title='Build Note', + content='

Handle with care

', + ) + + output = template.print([build]) + + self.assertTrue(output.complete) + self.assertIsNotNone(output.output) + self.assertTrue(output.output.name.endswith('.pdf')) + + def test_print_stock_location(self): + """Test that the built-in Stock Location report renders each item's note. + + Regression test: this report renders each contained StockItem's note + inline via the '{% note %}' tag - StockItem.notes is now a QuerySet + (via InvenTreeNoteMixin), not text, so the old '{{ line.notes }}' would + render a broken QuerySet repr instead of note content. + + Renders the template directly (rather than going through + ReportTemplate.print(), as test_print_build_order does) because + StockLocation.report_context() unconditionally generates a barcode, + which depends on a barcode plugin being registered - unrelated to what + this test is actually checking, and not reliably available in every + test environment. + """ + location = StockLocation.objects.create(name='Note Report Test Location') + item = StockItem.objects.create( + part=Part.objects.first(), quantity=5, location=location + ) + + Note.objects.create( + model_type=ContentType.objects.get_for_model(StockItem), + model_id=item.pk, + title='Item Note', + content='

Fragile handle with care

', + ) + + html = render_to_string( + 'report/inventree_stock_location_report.html', + { + 'stock_location': location, + 'stock_items': StockItem.objects.filter(location=location), + 'report_revision': 1, + 'date': now(), + }, + ) + + self.assertIn('Fragile', html) + self.assertIn('handle with care', html) + def test_print_custom_template(self): """Create a new template, print it, and check the output.""" template_string = """ diff --git a/src/backend/InvenTree/stock/api.py b/src/backend/InvenTree/stock/api.py index d6dfa94008..8355fbfbed 100644 --- a/src/backend/InvenTree/stock/api.py +++ b/src/backend/InvenTree/stock/api.py @@ -54,6 +54,7 @@ from InvenTree.mixins import ( RetrieveUpdateDestroyAPI, SerializerContextMixin, ) +from InvenTree.serializers import apply_duplicate_copy_options from order.models import PurchaseOrder, ReturnOrder, SalesOrder, TransferOrder from order.serializers import ( PurchaseOrderSerializer, @@ -1260,9 +1261,30 @@ class StockList( serializer = self.get_serializer(data=data) serializer.is_valid(raise_exception=True) + # Extract 'duplicate' options (if provided) - these are not valid model fields + duplicate = serializer.validated_data.pop('duplicate', None) + # Extract location information location = serializer.validated_data.get('location', None) + def apply_duplicate_options(item): + """Apply any provided 'duplicate' options to a newly created StockItem.""" + if not duplicate: + return + + original = duplicate['original'] + + # copy_history/copy_tests don't follow the copy__from() naming + # convention (copyHistoryFrom/copyTestResultsFrom), so still need + # handling here - only copy_notes can go through the shared helper + apply_duplicate_copy_options(item, duplicate, original, copy_notes=True) + + if duplicate.get('copy_history', False): + item.copyHistoryFrom(original) + + if duplicate.get('copy_tests', False): + item.copyTestResultsFrom(original) + with transaction.atomic(): if serials: # Create multiple serialized StockItem objects @@ -1278,6 +1300,8 @@ class StockList( item.set_status(status_value) item.save() + apply_duplicate_options(item) + if entry := item.add_tracking_entry( StockHistoryCode.CREATED, user, @@ -1310,6 +1334,8 @@ class StockList( item.save(user=user) item.refresh_from_db() + apply_duplicate_options(item) + response_data = [ StockSerializers.StockItemSerializer( item, context=self.get_serializer_context() diff --git a/src/backend/InvenTree/stock/migrations/0128_remove_stockitem_notes.py b/src/backend/InvenTree/stock/migrations/0128_remove_stockitem_notes.py new file mode 100644 index 0000000000..ee7d26fd4d --- /dev/null +++ b/src/backend/InvenTree/stock/migrations/0128_remove_stockitem_notes.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.14 on 2026-05-25 12:36 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("stock", "0127_alter_stockitemtestresult_options"), + ("common", "0052_remove_notesimage_model_id_and_more") + ] + + operations = [ + migrations.RemoveField( + model_name="stockitem", + name="notes", + ), + ] diff --git a/src/backend/InvenTree/stock/models.py b/src/backend/InvenTree/stock/models.py index c27ea7be74..b3f7971637 100644 --- a/src/backend/InvenTree/stock/models.py +++ b/src/backend/InvenTree/stock/models.py @@ -426,7 +426,7 @@ STOCK_SORT_DEFAULT = StockSortOrder.DATE_OLDEST class StockItem( InvenTree.models.InvenTreeAttachmentMixin, InvenTree.models.InvenTreeBarcodeMixin, - InvenTree.models.InvenTreeNotesMixin, + InvenTree.models.InvenTreeNoteMixin, InvenTree.models.InvenTreeTagsMixin, StatusCodeMixin, report.mixins.InvenTreeReportMixin, diff --git a/src/backend/InvenTree/stock/serializers.py b/src/backend/InvenTree/stock/serializers.py index 4e10db879a..d4f5e9a879 100644 --- a/src/backend/InvenTree/stock/serializers.py +++ b/src/backend/InvenTree/stock/serializers.py @@ -328,6 +328,8 @@ class StockItemSerializer( export_exclude_fields = ['tags', 'tracking_items'] + SKIP_CREATE_FIELDS = ['duplicate'] + export_child_fields = [ 'part_detail.name', 'part_detail.description', @@ -363,7 +365,6 @@ class StockItemSerializer( 'in_stock', 'is_building', 'link', - 'notes', 'owner', 'packaging', 'parent', @@ -385,6 +386,7 @@ class StockItemSerializer( 'purchase_price_currency', 'use_pack_size', 'serial_numbers', + 'duplicate', # Annotated fields 'allocated', 'expired', @@ -472,6 +474,28 @@ class StockItemSerializer( help_text=_('Enter serial numbers for new items'), ) + # Extra field used only for creation of a new StockItem instance + duplicate = InvenTree.serializers.DuplicateOptionsSerializer( + StockItem.objects.all(), + label=_('Duplicate Stock Item'), + help_text=_('Copy initial data from another stock item'), + copy_notes=True, + copy_fields=[ + { + 'name': 'copy_tests', + 'label': _('Copy Test Results'), + 'help_text': _('Copy test results from the original stock item'), + 'default': False, + }, + { + 'name': 'copy_history', + 'label': _('Copy History'), + 'help_text': _('Copy stock history from the original stock item'), + 'default': False, + }, + ], + ) + def validate_part(self, part): """Ensure the provided Part instance is valid.""" if part.virtual: diff --git a/src/backend/InvenTree/stock/test_api.py b/src/backend/InvenTree/stock/test_api.py index 6cf57bd2c5..6aecf8c85e 100644 --- a/src/backend/InvenTree/stock/test_api.py +++ b/src/backend/InvenTree/stock/test_api.py @@ -17,7 +17,7 @@ import build.models import company.models import order.models import part.models -from common.models import InvenTreeCustomUserStateModel, InvenTreeSetting +from common.models import InvenTreeCustomUserStateModel, InvenTreeSetting, Note from common.settings import set_global_setting from InvenTree.unit_test import ( InvenTreeAPIPerformanceTestCase, @@ -1634,6 +1634,50 @@ class StockItemTest(StockAPITestCase): self.assertEqual(response.data[0]['location'], None) + def test_duplicate_copies_notes(self): + """Test that notes are copied when duplicating a StockItem via the API. + + StockItemSerializer declares its 'duplicate' options with copy_notes=True, + so notes should be copied by default (i.e. without explicitly requesting it). + """ + part = Part.objects.create(name='Duplicate Notes Part', description='x') + + original = StockItem.objects.create(part=part, quantity=10) + + Note.objects.create( + model_type=ContentType.objects.get_for_model(StockItem), + model_id=original.pk, + title='Original Note', + content='

Some stock item notes

', + ) + + response = self.post( + self.list_url, + data={ + 'part': part.pk, + 'quantity': 5, + 'duplicate': {'original': original.pk}, + }, + expected_code=201, + ) + + new_item = StockItem.objects.get(pk=response.data[0]['pk']) + self.assertEqual(new_item.notes.count(), 1) + self.assertEqual(new_item.notes.first().content, '

Some stock item notes

') + + # Explicitly disabling copy_notes must not copy any notes + response = self.post( + self.list_url, + data={ + 'part': part.pk, + 'quantity': 5, + 'duplicate': {'original': original.pk, 'copy_notes': False}, + }, + expected_code=201, + ) + no_notes_item = StockItem.objects.get(pk=response.data[0]['pk']) + self.assertEqual(no_notes_item.notes.count(), 0) + def test_stock_item_create(self): """Test creation of a StockItem via the API.""" # POST with an empty part reference diff --git a/src/backend/InvenTree/users/ruleset.py b/src/backend/InvenTree/users/ruleset.py index c5912e9358..ff9968963b 100644 --- a/src/backend/InvenTree/users/ruleset.py +++ b/src/backend/InvenTree/users/ruleset.py @@ -206,6 +206,7 @@ def get_ruleset_ignore() -> list[str]: 'common_inventreeusersetting', 'common_notificationentry', 'common_notificationmessage', + 'common_note', 'common_notesimage', 'common_projectcode', 'common_webhookendpoint', diff --git a/src/backend/InvenTree/users/test_migrations.py b/src/backend/InvenTree/users/test_migrations.py index 7f70016c9d..541ff2c893 100644 --- a/src/backend/InvenTree/users/test_migrations.py +++ b/src/backend/InvenTree/users/test_migrations.py @@ -61,7 +61,16 @@ class TestBackfillUserProfiles(MigratorTestCase): class MFAMigrations(MigratorTestCase): """Test entire schema migration sequence for the users app.""" - migrate_from = ('users', '0012_alter_ruleset_can_view') + # NOTE: otp_totp / otp_static are pinned explicitly (not just relying on + # 'users' 0012) because the merged cross-app migration plan that + # django_test_migrations truncates against is only incidentally ordered - + # unrelated migrations elsewhere in the project can shift whether these + # third-party app migrations land before or after 'users' 0012. + migrate_from = [ + ('users', '0012_alter_ruleset_can_view'), + ('otp_totp', '0002_auto_20190420_0723'), + ('otp_static', '0002_throttling'), + ] migrate_to = ('users', '0013_migrate_mfa_20240408_1659') def prepare(self): diff --git a/src/frontend/lib/enums/ApiEndpoints.tsx b/src/frontend/lib/enums/ApiEndpoints.tsx index fc1e9bf30b..52f777474d 100644 --- a/src/frontend/lib/enums/ApiEndpoints.tsx +++ b/src/frontend/lib/enums/ApiEndpoints.tsx @@ -252,10 +252,12 @@ export enum ApiEndpoints { // Miscellaneous API endpoints attachment_list = 'attachment/', + instance_info = 'instance-info/', error_report_list = 'error-report/', project_code_list = 'project-code/', custom_unit_list = 'units/', - notes_image_upload = 'notes-image-upload/', + note_list = 'note/', + notes_image_list = 'note/image/', email_list = 'admin/email/', email_test = 'admin/email/test/', scim_config = 'admin/scim/', diff --git a/src/frontend/lib/enums/ModelInformation.tsx b/src/frontend/lib/enums/ModelInformation.tsx index 39d597202b..cdb6e6692b 100644 --- a/src/frontend/lib/enums/ModelInformation.tsx +++ b/src/frontend/lib/enums/ModelInformation.tsx @@ -368,5 +368,12 @@ export const ModelInformationDict: ModelDict = { label_multiple: () => t`Tags`, api_endpoint: ApiEndpoints.tag_list, icon: 'tag' + }, + notetemplate: { + label: () => t`Note Template`, + label_multiple: () => t`Note Templates`, + url_overview: '/settings/admin/notes', + api_endpoint: ApiEndpoints.note_list, + icon: 'notes' } }; diff --git a/src/frontend/lib/enums/ModelType.tsx b/src/frontend/lib/enums/ModelType.tsx index 76642756e2..e3bddd7d2d 100644 --- a/src/frontend/lib/enums/ModelType.tsx +++ b/src/frontend/lib/enums/ModelType.tsx @@ -39,7 +39,8 @@ export enum ModelType { selectionlist = 'selectionlist', selectionentry = 'selectionentry', error = 'error', - tag = 'tag' + tag = 'tag', + notetemplate = 'notetemplate' } export enum PluginPanelKey { diff --git a/src/frontend/package.json b/src/frontend/package.json index 6012b0831d..0cad2737e2 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -49,6 +49,7 @@ "@codemirror/state": "^6.6.0", "@codemirror/theme-one-dark": "^6.1.3", "@codemirror/view": "^6.40.0", + "@floating-ui/dom": "^1.0.0", "@emotion/react": "^11.14.0", "@fortawesome/fontawesome-svg-core": "^7.2.0", "@fortawesome/free-regular-svg-icons": "^7.2.0", @@ -71,11 +72,20 @@ "@mantine/modals": "^9.2.1", "@mantine/notifications": "^9.2.1", "@mantine/spotlight": "^9.2.1", + "@mantine/tiptap": "^9.2.1", + "@mantine/utils": "^6.0.22", "@mantine/vanilla-extract": "^9.2.1", "@messageformat/date-skeleton": "^1.1.0", "@sentry/react": "^10.57.0", "@tabler/icons-react": "^3.44.0", "@tanstack/react-query": "^5.101.0", + "@tiptap/core": "^3.23.6", + "@tiptap/extension-image": "^3.23.6", + "@tiptap/extension-link": "^3.23.6", + "@tiptap/extension-table": "^3.23.6", + "@tiptap/pm": "^3.23.6", + "@tiptap/react": "^3.23.6", + "@tiptap/starter-kit": "^3.23.6", "@uiw/codemirror-theme-vscode": "^4.25.8", "@uiw/react-codemirror": "^4.25.8", "@uiw/react-split": "^5.9.4", @@ -85,7 +95,6 @@ "codemirror": "^6.0.2", "dayjs": "^1.11.21", "dompurify": "^3.4.8", - "easymde": "^2.21.0", "embla-carousel": "^8.6.0", "embla-carousel-react": "^8.6.0", "fuse.js": "^7.4.2", @@ -100,10 +109,10 @@ "react-is": "^19.2.7", "react-router-dom": "^6.30.4", "react-select": "^5.10.2", - "react-simplemde-editor": "^5.2.0", "react-window": "1.8.11", "recharts": "^3.8.1", "styled-components": "^6.4.2", + "tiptap-extension-resizable-image": "^2.1.0", "undici": "^8.4.1", "zustand": "^5.0.14" }, @@ -141,7 +150,10 @@ "vite-plugin-externals": "^0.6.2", "vite-plugin-istanbul": "^9.0.1" }, + "overrides": { + }, "resolutions": { + "glob": "^13.0.0", "undici": "^6.24.0", "vite": "^7", "js-yaml": "^4", diff --git a/src/frontend/src/components/editors/NotesEditor.css b/src/frontend/src/components/editors/NotesEditor.css new file mode 100644 index 0000000000..b674d06d10 --- /dev/null +++ b/src/frontend/src/components/editors/NotesEditor.css @@ -0,0 +1,82 @@ +/* Table styles for the Tiptap notes editor */ +.ProseMirror table { + border-collapse: collapse; + table-layout: fixed; + width: 100%; + overflow: hidden; + margin: 0; +} + +.ProseMirror table td, +.ProseMirror table th { + border: 1px solid var(--mantine-color-gray-4); + padding: 4px 8px; + vertical-align: top; + box-sizing: border-box; + position: relative; + min-width: 50px; +} + +[data-mantine-color-scheme='dark'] .ProseMirror table td, +[data-mantine-color-scheme='dark'] .ProseMirror table th { + border-color: var(--mantine-color-dark-4); +} + +.ProseMirror table th { + background-color: var(--mantine-color-gray-1); + font-weight: bold; +} + +[data-mantine-color-scheme='dark'] .ProseMirror table th { + background-color: var(--mantine-color-dark-6); +} + +/* Selected cell highlight */ +.ProseMirror table .selectedCell::after { + content: ''; + position: absolute; + inset: 0; + background: var(--mantine-color-blue-1); + opacity: 0.4; + pointer-events: none; +} + +[data-mantine-color-scheme='dark'] .ProseMirror table .selectedCell::after { + background: var(--mantine-color-blue-9); +} + +/* Column resize handle */ +.ProseMirror table .column-resize-handle { + position: absolute; + right: -2px; + top: 0; + bottom: 0; + width: 4px; + background-color: var(--mantine-color-blue-5); + pointer-events: none; + cursor: col-resize; +} + +/* Scrollable wrapper for wide tables */ +.ProseMirror .tableWrapper { + overflow-x: auto; +} + +/* Resize cursor while dragging */ +.ProseMirror.resize-cursor { + cursor: col-resize; +} + +/* Disable image interaction when not in editing mode */ +.mantine-RichTextEditor-root:not([data-editing]) .ProseMirror img { + pointer-events: none; + user-select: none; +} + +.mantine-RichTextEditor-root:not([data-editing]) .node-image.ProseMirror-selectednode .image-component { + outline: none; +} + +.mantine-RichTextEditor-root:not([data-editing]) .node-image.ProseMirror-selectednode .image-resizer { + display: none; +} diff --git a/src/frontend/src/components/editors/NotesEditor.tsx b/src/frontend/src/components/editors/NotesEditor.tsx index 7f1920ac9a..8c12e45ff5 100644 --- a/src/frontend/src/components/editors/NotesEditor.tsx +++ b/src/frontend/src/components/editors/NotesEditor.tsx @@ -1,239 +1,760 @@ import { t } from '@lingui/core/macro'; +import { RichTextEditor } from '@mantine/tiptap'; +import '@mantine/tiptap/styles.css'; +import { useHotkeys } from '@mantine/hooks'; import { notifications } from '@mantine/notifications'; -import { useQuery } from '@tanstack/react-query'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import { TableKit } from '@tiptap/extension-table'; +import { useEditor, useEditorState } from '@tiptap/react'; +import StarterKit from '@tiptap/starter-kit'; import DOMPurify from 'dompurify'; -import EasyMDE, { type default as SimpleMde } from 'easymde'; -import 'easymde/dist/easymde.min.css'; -import { useCallback, useEffect, useMemo, useState } from 'react'; -import SimpleMDE from 'react-simplemde-editor'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { useSearchParams } from 'react-router-dom'; +import { ResizableImage } from 'tiptap-extension-resizable-image'; +import 'tiptap-extension-resizable-image/styles.css'; +import './NotesEditor.css'; import { ApiEndpoints } from '@lib/enums/ApiEndpoints'; -import { ModelInformationDict } from '@lib/enums/ModelInformation'; import type { ModelType } from '@lib/enums/ModelType'; import { apiUrl } from '@lib/functions/Api'; import { useApi } from '../../contexts/ApiContext'; -/* - * A text editor component for editing notes against a model type and instance. - * Uses the react-simple-mde editor: https://github.com/RIP21/react-simplemde-editor - * - * TODO: - * - Disable editing by default when the component is launched - user can click an "edit" button to enable - * - Allow image resizing in the future (requires back-end validation changes)) - * - Allow user to configure the editor toolbar (i.e. hide some buttons if they don't want them) - */ +import { identifierString } from '@lib/functions/Conversion'; +import { + ActionIcon, + Alert, + Badge, + Box, + Button, + FileButton, + Flex, + Group, + HoverCard, + Paper, + Stack, + Tabs, + Text, + Tooltip +} from '@mantine/core'; +import { + IconCheck, + IconCirclePlus, + IconColumnInsertLeft, + IconColumnInsertRight, + IconColumnRemove, + IconDeviceFloppy, + IconInfoCircle, + IconPencil, + IconPhoto, + IconReload, + IconRowInsertBottom, + IconRowInsertTop, + IconRowRemove, + IconStar, + IconTableOff, + IconTablePlus, + IconTableRow +} from '@tabler/icons-react'; +import { formatDate } from '../../defaults/formatters'; +import { useNoteFields, useNoteTemplateFields } from '../../forms/CommonForms'; +import { + useCreateApiFormModal, + useDeleteApiFormModal, + useEditApiFormModal +} from '../../hooks/UseForm'; +import { useUserState } from '../../states/UserState'; +import { + DeleteItemAction, + EditItemAction, + OptionsActionDropdown +} from '../items/ActionDropdown'; +import { RenderUser } from '../render/User'; + +function NoteInfoHover({ note }: { note: any }) { + if (!note?.pk) { + return null; + } + + return ( + + + + + + + + + {note.updated && ( + + {t`Updated`} + + {formatDate(note.updated, { showTime: true })} + + + )} + {note.updated_by_detail && ( + + {t`Updated by`} + + + )} + + + + ); +} + export default function NotesEditor({ modelType, modelId, - editable, + templateMode = false, setDirtyCallback }: Readonly<{ - modelType: ModelType; - modelId: number; - editable?: boolean; + modelType?: ModelType; + modelId?: number; + templateMode?: boolean; setDirtyCallback?: (dirty: boolean) => void; }>) { const api = useApi(); - // In addition to the editable prop, we also need to check if the user has "enabled" editing - const [editing, setEditing] = useState(false); - const [localIsDirty, setLocalIsDirty] = useState(false); + const user = useUserState(); + const queryClient = useQueryClient(); + const [searchParams, setSearchParams] = useSearchParams(); - const [markdown, setMarkdown] = useState(''); + const [isEditing, setIsEditing] = useState(false); - useEffect(() => { - // Initially disable editing mode on load - setEditing(false); - }, [editable, modelId, modelType]); + const [isDirty, setIsDirty] = useState(false); - useEffect(() => { - setDirtyCallback?.(localIsDirty); - }, [localIsDirty]); + const [selectedNoteId, setSelectedNoteId] = useState( + undefined + ); - const noteUrl: string = useMemo(() => { - const modelInfo = ModelInformationDict[modelType]; - return apiUrl(modelInfo.api_endpoint, modelId); - }, [modelType, modelId]); - - // Image upload handler - const imageUploadHandler = useCallback( - ( - file: File, - onSuccess: (url: string) => void, - onError: (error: string) => void - ) => { + // Callback to upload an image file against the currently selected note + const uploadFile = useCallback( + async (file: File): Promise => { const formData = new FormData(); + formData.append('note', selectedNoteId?.toString() ?? ''); formData.append('image', file); - formData.append('model_type', modelType); - formData.append('model_id', modelId.toString()); - - api - .post(apiUrl(ApiEndpoints.notes_image_upload), formData, { - headers: { - 'Content-Type': 'multipart/form-data' - } + return api + .post(apiUrl(ApiEndpoints.notes_image_list), formData, { + headers: { 'Content-Type': 'multipart/form-data' } }) - .catch((error) => { - onError(error.message); - notifications.hide('notes'); - notifications.show({ - id: 'notes', - title: t`Error`, - message: t`Image upload failed`, - color: 'red' - }); - }) - .then((response: any) => { - onSuccess(response.data.image); - notifications.hide('notes'); - notifications.show({ - id: 'notes', - title: t`Success`, - message: t`Image uploaded successfully`, - color: 'green' - }); - }); + .then((response) => response.data.image); }, - [modelType, modelId] + [selectedNoteId] ); - const dataQuery = useQuery({ - queryKey: ['notes-editor', noteUrl, modelType, modelId], - retry: 5, - queryFn: () => - api.get(noteUrl).then((response) => response.data?.notes ?? ''), - enabled: true + // Ref so editorProps handlers always call the latest uploadFile without stale closure + const uploadFileRef = useRef(uploadFile); + useEffect(() => { + uploadFileRef.current = uploadFile; + }, [uploadFile]); + + const editor = useEditor({ + editable: false, + extensions: [ + StarterKit.configure({ + link: { openOnClick: false } + }), + ResizableImage.configure({ + // Paste and drop are handled by the extension's built-in plugin + onUpload: async (file: File) => { + const src = await uploadFileRef.current(file); + return { src, 'data-keep-ratio': true }; + } + }), + TableKit.configure({ + table: { resizable: false, renderWrapper: true, cellMinWidth: 50 } + }) + ], + content: '', + onUpdate: () => setIsDirty(true) }); - // Update internal markdown data when the query data changes - useEffect(() => { - setMarkdown(dataQuery.data ?? ''); - }, [dataQuery.data]); - - // Callback to save notes to the server - const saveNotes = useCallback( - (markdown: string) => { - if (!noteUrl) { - return; - } - - api - .patch(noteUrl, { notes: markdown }) - .then(() => { - notifications.hide('notes'); - notifications.show({ - title: t`Success`, - message: t`Notes saved successfully`, - color: 'green', - id: 'notes', - autoClose: 2000 - }); - setLocalIsDirty(false); - }) - .catch((error) => { - notifications.hide('notes'); - - const msg = - error?.response?.data?.non_field_errors[0] ?? - t`Failed to save notes`; - - notifications.show({ - title: t`Error Saving Notes`, - message: msg, - color: 'red', - id: 'notes' - }); - }); - }, - [api, noteUrl] + const notesQueryKey = useMemo( + () => ['notes', modelType, modelId, templateMode], + [modelType, modelId, templateMode] ); - const editorOptions: SimpleMde.Options = useMemo(() => { - const icons: any[] = []; + // Fetch the available notes for the given model type and ID (or all templates) + const notesQuery = useQuery({ + queryKey: notesQueryKey, + queryFn: async () => { + const params: Record = templateMode + ? { template: true } + : { model_id: modelId, model_type: modelType }; - if (editing) { - icons.push({ - name: 'save-notes', - action: (editor: SimpleMde) => { - saveNotes(editor.value()); - }, - className: 'fa fa-save', - title: t`Save Notes` - }); + return api + .get(apiUrl(ApiEndpoints.note_list), { params }) + .then((response) => response.data ?? []); + }, + staleTime: 0, + refetchOnWindowFocus: false, + refetchOnMount: true, + enabled: templateMode ? true : !!modelId && !!modelType + }); - icons.push('|'); + const [selectedNote, setSelectedNote] = useState(undefined); - icons.push('heading-1', 'heading-2', 'heading-3', '|'); // Headings - icons.push('bold', 'italic', 'strikethrough', '|'); // Text styles - icons.push('unordered-list', 'ordered-list', 'code', 'quote', '|'); // Text formatting - icons.push('table', 'link', 'image', '|'); - icons.push('horizontal-rule', '|', 'guide'); // Misc + // Push a note's content into the editor, discarding any local unsaved edits. + // Used both for switching to a different note, and for the explicit "reset" + // action, which intentionally discards unsaved changes. + const applyNoteContent = useCallback( + (note: any) => { + if (editor && !editor.isDestroyed) { + // Pass emitUpdate:false to avoid triggering dirty state when loading content + editor.commands.setContent( + note ? DOMPurify.sanitize(note.content ?? '') : '', + { emitUpdate: false } + ); + } - icons.push('|', 'undo', 'redo'); // Undo/Redo + setIsDirty(false); + }, + [editor] + ); - icons.push('|'); - - icons.push({ - name: 'edit-disabled', - action: () => setEditing(false), - className: 'fa fa-times', - title: t`Close Editor` - }); - } else if (editable) { - icons.push({ - name: 'edit-enabled', - action: () => setEditing(true), - className: 'fa fa-edit', - title: t`Enable Editing` - }); - } - - return { - toolbar: icons, - uploadImage: true, - imagePathAbsolute: true, - imageUploadFunction: imageUploadHandler, - renderingConfig: { - sanitizerFunction: (html: string) => { - return DOMPurify.sanitize(html); - } - }, - sideBySideFullscreen: false, - shortcuts: {}, - spellChecker: false - }; - }, [editable, editing]); - - const [mdeInstance, setMdeInstance] = useState(null); + // Track which note's content is currently loaded into the editor. A + // background refetch of the notes list (e.g. after saving, editing a note's + // metadata elsewhere, or another tab changing notes) must not silently + // overwrite content the user is actively editing - only (re)load editor + // content when the selected note itself changes, or when there are no + // unsaved local edits to protect. Header metadata (title/description/etc.) + // stays in sync regardless, since only the editor content is at risk. + const loadedNoteIdRef = useRef(undefined); useEffect(() => { - if (mdeInstance) { - const previewMode = !(editable && editing); + const noteId = selectedNoteId ?? -1; + const note = notesQuery.data?.find((note: any) => note.pk === noteId); - mdeInstance.codemirror?.setOption('readOnly', previewMode); + setSelectedNote(note); - // Ensure the preview mode is toggled if required - if (mdeInstance.isPreviewActive() != previewMode) { - const sibling = - mdeInstance?.codemirror.getWrapperElement()?.nextSibling; - - if (sibling != null && editable != false) { - EasyMDE.togglePreview(mdeInstance); - } - } + const switchingNote = loadedNoteIdRef.current !== noteId; + if (switchingNote || !isDirty) { + loadedNoteIdRef.current = noteId; + applyNoteContent(note); } - }, [mdeInstance, editable, editing]); + }, [editor, selectedNoteId, notesQuery.data, isDirty, applyNoteContent]); + + // Adjust the note selection + useEffect(() => { + if (!notesQuery.data) return; + + const stillExists = + selectedNoteId && + notesQuery.data.some((note: any) => note.pk === selectedNoteId); + if (stillExists) return; + + const paramSlug = searchParams.get('note'); + const fromParam = + paramSlug && + notesQuery.data.find( + (note: any) => identifierString(note.title ?? '') === paramSlug + ); + + if (fromParam) { + setSelectedNoteId(fromParam.pk); + return; + } + + const primary = notesQuery.data.find((note: any) => note.primary); + setSelectedNoteId((primary ?? notesQuery.data[0])?.pk ?? undefined); + }, [notesQuery.data]); + + // Templates are staff-only; regular notes follow the linked model's permissions + const hasNotePermission = useCallback( + (action: 'change' | 'delete'): boolean => { + if (templateMode) { + return user.isStaff(); + } + if (!modelType) { + return false; + } + return action === 'change' + ? user.hasChangePermission(modelType) + : user.hasDeletePermission(modelType); + }, + [user, modelType, templateMode] + ); + + const canEdit: boolean = useMemo( + () => + hasNotePermission('change') && + notesQuery.isFetched && + notesQuery.isSuccess && + !!notesQuery.data, + [hasNotePermission, notesQuery] + ); + + const isInTable = useEditorState({ + editor, + selector: ({ editor: e }) => e?.isActive('table') ?? false + }); + + // Propagate dirty state up to the panel system for navigation guards + useEffect(() => { + setDirtyCallback?.(isDirty); + }, [isDirty, setDirtyCallback]); + + // Sync editor editable state when permissions change. + // Pass false for emitUpdate to avoid triggering onUpdate (which sets isDirty). + useEffect(() => { + editor?.setEditable(canEdit && isEditing, false); + }, [editor, canEdit, isEditing]); + + const hasNotes = useMemo(() => { + return notesQuery.data && notesQuery.data.length > 0; + }, [notesQuery.data]); + + const noteFields = useNoteFields({ + modelType: modelType!, + modelId: modelId! + }); + const noteTemplateFields = useNoteTemplateFields(); + const activeFields = templateMode ? noteTemplateFields : noteFields; + + const createNote = useCreateApiFormModal({ + title: templateMode ? t`Add Note Template` : t`Add Note`, + fields: activeFields, + url: apiUrl(ApiEndpoints.note_list), + method: 'POST', + successMessage: null, + onFormSuccess: (response: any) => { + notesQuery.refetch().then(() => { + setSelectedNoteId(response.pk); + }); + } + }); + + const deleteNote = useDeleteApiFormModal({ + title: templateMode ? t`Delete Note Template` : t`Delete Note`, + url: apiUrl(ApiEndpoints.note_list), + pk: selectedNoteId, + onFormSuccess: () => { + // Deleting the currently-open note can leave no note selected (if it was + // the last one) - exit edit mode too, so the UI doesn't get stranded + // with 'isEditing' stuck true and nothing left to edit/select. + setIsEditing(false); + setSelectedNoteId(undefined); + notesQuery.refetch(); + } + }); + + const editNote = useEditApiFormModal({ + title: templateMode ? t`Edit Note Template` : t`Edit Note`, + fields: activeFields, + url: apiUrl(ApiEndpoints.note_list), + pk: selectedNoteId, + onFormSuccess: (response: any) => { + notesQuery.refetch().then(() => { + setSelectedNoteId(response.pk); + }); + } + }); + + const reloadNote = useCallback(() => { + const note = notesQuery.data?.find( + (note: any) => note.pk === (selectedNoteId ?? -1) + ); + applyNoteContent(note); + }, [selectedNoteId, notesQuery.data, applyNoteContent]); + + const saveNote = useCallback(() => { + // Guard against the global mod+s hotkey firing while there's nothing to + // save - e.g. the user isn't currently editing this note, or lacks + // permission to (in which case the editor was never made editable, so + // there's nothing dirty to persist anyway). + if (!canEdit || !isEditing || !selectedNoteId || !editor) { + return; + } + + const cleanHtml = DOMPurify.sanitize(editor.getHTML()); + + const url = apiUrl(ApiEndpoints.note_list, selectedNoteId); + + notifications.hide('note-update-status'); + + api + .patch(url, { content: cleanHtml }) + .then((response) => { + // Merge the updated note directly into the cached notes list, rather + // than refetching - a refetch is async, so the content-sync effect + // (keyed on isDirty) can run against the *old* cached data in the gap + // between setIsDirty(false) below and the refetch resolving, visibly + // reverting the editor to the pre-save content until it lands. + queryClient.setQueryData(notesQueryKey, (previous: any[] | undefined) => + previous?.map((note: any) => + note.pk === selectedNoteId ? (response.data ?? note) : note + ) + ); + setIsDirty(false); + notifications.show({ + title: t`Success`, + message: t`Note updated`, + color: 'green', + id: 'note-update-status', + autoClose: 2000 + }); + }) + .catch((error) => { + notifications.show({ + title: t`Error`, + message: t`Failed to update note: ${error.message}`, + color: 'red', + id: 'note-update-status', + autoClose: 2000 + }); + }); + }, [ + canEdit, + isEditing, + selectedNoteId, + editor, + queryClient, + notesQueryKey, + setIsDirty + ]); + + useHotkeys([['mod+s', saveNote]]); + + const handleImageUpload = useCallback( + async (file: File | null) => { + if (!file || !editor) return; + try { + const src = await uploadFile(file); + editor + .chain() + .focus() + .setResizableImage({ src, 'data-keep-ratio': true }) + .run(); + } catch { + notifications.show({ + title: t`Error`, + message: t`Failed to upload image`, + color: 'red', + autoClose: 2000 + }); + } + }, + [editor, uploadFile] + ); return ( - setMdeInstance(instance)} - onChange={(value: string) => { - setMarkdown(value); - setLocalIsDirty(true); - }} - options={editorOptions} - value={markdown} - /> + <> + {createNote.modal} + {deleteNote.modal} + {editNote.modal} + + + + {selectedNote && ( + + + + {selectedNote?.title} + {selectedNote?.description} + + {canEdit && ( + + {!isEditing && ( + + setIsEditing(true)} + > + + + + )} + {isEditing && isDirty && ( + {t`Unsaved Changes`} + )} + {isEditing && isDirty && ( + + + + + + )} + {isEditing && isDirty && ( + + + + + + )} + {isEditing && !isDirty && ( + + setIsEditing(false)} + color='green' + > + + + + )} + + { + editNote.open(); + } + }), + DeleteItemAction({ + hidden: + !selectedNote || + isEditing || + !hasNotePermission('delete'), + onClick: () => { + deleteNote.open(); + } + }) + ]} + /> + + )} + + + )} + + {hasNotes ? ( + + {canEdit && isEditing && ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {(props) => ( + + + + + + )} + + + + + editor + ?.chain() + .focus() + .insertTable({ + rows: 3, + cols: 3, + withHeaderRow: true + }) + .run() + } + aria-label={t`Insert table`} + title={t`Insert table`} + > + + + + editor?.chain().focus().addColumnBefore().run() + } + aria-label={t`Add column before`} + title={t`Add column before`} + > + + + + editor?.chain().focus().addColumnAfter().run() + } + aria-label={t`Add column after`} + title={t`Add column after`} + > + + + + editor?.chain().focus().deleteColumn().run() + } + aria-label={t`Delete column`} + title={t`Delete column`} + > + + + + editor?.chain().focus().addRowBefore().run() + } + aria-label={t`Add row before`} + title={t`Add row before`} + > + + + + editor?.chain().focus().addRowAfter().run() + } + aria-label={t`Add row after`} + title={t`Add row after`} + > + + + + editor?.chain().focus().deleteRow().run() + } + aria-label={t`Delete row`} + title={t`Delete row`} + > + + + + editor?.chain().focus().toggleHeaderRow().run() + } + aria-label={t`Toggle header row`} + title={t`Toggle header row`} + > + + + + editor?.chain().focus().deleteTable().run() + } + aria-label={t`Delete table`} + title={t`Delete table`} + > + + + + + + + + + )} + + + ) : ( + }> + {t`There are no notes here yet.`} + + )} + + + + + + {canEdit && ( + + )} + + + {notesQuery.data?.map((note: any) => ( + { + setSelectedNoteId(note.pk); + setSearchParams( + (prev) => { + prev.set('note', identifierString(note.title ?? '')); + return prev; + }, + { replace: true } + ); + }} + > + + {note.title} + {note.primary && ( + + )} + + + ))} + + + + + + ); } diff --git a/src/frontend/src/components/items/ActionDropdown.tsx b/src/frontend/src/components/items/ActionDropdown.tsx index 7daf6fac35..2875478758 100644 --- a/src/frontend/src/components/items/ActionDropdown.tsx +++ b/src/frontend/src/components/items/ActionDropdown.tsx @@ -134,16 +134,19 @@ export function ActionDropdown({ export function OptionsActionDropdown({ actions = [], tooltip = t`Options`, + tooltipPosition = 'bottom', hidden = false }: Readonly<{ actions: ActionDropdownItem[]; tooltip?: string; + tooltipPosition?: FloatingPosition; hidden?: boolean; }>) { return ( } tooltip={tooltip} + tooltipPosition={tooltipPosition} actions={actions} hidden={hidden} noindicator diff --git a/src/frontend/src/components/panels/AttachmentPanel.tsx b/src/frontend/src/components/panels/AttachmentPanel.tsx index 4ab4017717..b752864f99 100644 --- a/src/frontend/src/components/panels/AttachmentPanel.tsx +++ b/src/frontend/src/components/panels/AttachmentPanel.tsx @@ -3,38 +3,24 @@ import { Skeleton } from '@mantine/core'; import { IconPaperclip } from '@tabler/icons-react'; import type { ModelType } from '@lib/enums/ModelType'; -import { ApiEndpoints, apiUrl } from '@lib/index'; import type { PanelType } from '@lib/types/Panel'; -import { api } from '../../App'; import { AttachmentTable } from '../../tables/general/AttachmentTable'; export default function AttachmentPanel({ model_type, - model_id + model_id, + attachment_count }: { model_type: ModelType; model_id: number | undefined; + attachment_count?: number; }): PanelType { return { name: 'attachments', label: t`Attachments`, icon: , hotkey: 'mod+Shift+A', - notification_dot: async () => { - if (!model_type || !model_id) { - return null; - } - - return api - .get(apiUrl(ApiEndpoints.attachment_list), { - params: { - model_type: model_type, - model_id: model_id, - limit: 1 - } - }) - .then((response) => ((response.data?.count ?? 0) > 0 ? 'info' : null)); - }, + notification_dot: attachment_count ? 'info' : null, content: model_type && model_id ? ( diff --git a/src/frontend/src/components/panels/NotesPanel.tsx b/src/frontend/src/components/panels/NotesPanel.tsx index fe5b01d627..7d6ef6ad06 100644 --- a/src/frontend/src/components/panels/NotesPanel.tsx +++ b/src/frontend/src/components/panels/NotesPanel.tsx @@ -4,37 +4,30 @@ import { IconNotes } from '@tabler/icons-react'; import type { ModelType } from '@lib/enums/ModelType'; import type { PanelType } from '@lib/types/Panel'; -import { lazy } from 'react'; -import { useUserState } from '../../states/UserState'; +import NotesEditor from '../editors/NotesEditor'; -const NotesEditor = lazy(() => import('../editors/NotesEditor')); +// const NotesEditor = lazy(() => import('../editors/NotesEditor')); export default function NotesPanel({ model_type, model_id, editable, - has_note + note_count }: { model_type: ModelType; model_id: number | undefined; editable?: boolean; - has_note?: boolean; + note_count?: number; }): PanelType { - const user = useUserState.getState(); - return { name: 'notes', label: t`Notes`, icon: , hotkey: 'mod+Shift+N', - notification_dot: has_note ? 'info' : null, + notification_dot: note_count ? 'info' : null, content: model_type && model_id ? ( - + ) : ( ), diff --git a/src/frontend/src/components/panels/PanelGroup.tsx b/src/frontend/src/components/panels/PanelGroup.tsx index e8efb4a91b..05e74d23bc 100644 --- a/src/frontend/src/components/panels/PanelGroup.tsx +++ b/src/frontend/src/components/panels/PanelGroup.tsx @@ -1,5 +1,6 @@ import { ActionIcon, + Alert, Box, Divider, Group, @@ -10,10 +11,12 @@ import { Stack, Tabs, Text, + Title, Tooltip, UnstyledButton } from '@mantine/core'; import { + IconExclamationCircle, IconLayoutSidebarLeftCollapse, IconLayoutSidebarRightCollapse } from '@tabler/icons-react'; @@ -51,6 +54,7 @@ import type { } from '@lib/types/Panel'; import { t } from '@lingui/core/macro'; import { useDocumentVisibility, useWindowEvent } from '@mantine/hooks'; +import { modals } from '@mantine/modals'; import { useQuery } from '@tanstack/react-query'; import { useShallow } from 'zustand/react/shallow'; import { generateUrl } from '../../functions/urls'; @@ -105,26 +109,34 @@ function PanelTabComponent({ const visibility = useDocumentVisibility(); const location = useLocation(); - // Check if we should display an indicator dot for this panel + const isDynamicDot = typeof panel.notification_dot === 'function'; + + // Check if we should display an indicator dot for this panel. + // Only self-fetching (function) dots go through react-query, as they need + // caching around their own async call. Static dot values are derived from + // props the caller already re-renders on, so they are read directly below - + // routing them through a query keyed only on panel.name would freeze the + // first-seen value (e.g. `null` before data loads) and never update. const notificationDot = useQuery({ - enabled: panel.notification_dot !== undefined && visibility === 'visible', + enabled: isDynamicDot && visibility === 'visible', queryKey: ['panel-notification', panel.name], queryFn: async () => { - if (panel.notification_dot === undefined) { - return null; - } else if (typeof panel.notification_dot === 'function') { + if (typeof panel.notification_dot === 'function') { return await panel.notification_dot(); - } else { - return panel.notification_dot as PanelIndicatorType; } + return null; }, staleTime: 5 * 60 * 1000, // cache for 5 minutes refetchOnMount: false, refetchOnWindowFocus: false }); + const indicatorValue: PanelIndicatorType | undefined = isDynamicDot + ? notificationDot.data + : (panel.notification_dot as PanelIndicatorType | undefined); + const indicatorColor: MantineColor | undefined = useMemo(() => { - switch (notificationDot.data) { + switch (indicatorValue) { case 'info': return 'blue'; case 'warning': @@ -134,7 +146,7 @@ function PanelTabComponent({ default: return undefined; } - }, [notificationDot.data]); + }, [indicatorValue]); return ( { + if (isDirty) { + event.preventDefault(); + } + }); + + const performPanelChange = useCallback( (targetPanel: string, event?: any) => { - cancelEvent(event); - - // check if we are currently on a dirty panel, if so prompt the user to confirm navigation - if (isDirty) { - const confirm = globalThis.confirm( - t`You have unsaved changes, are you sure you want to navigate away from this panel?` - ); - if (!confirm) { - return; - } - } - if (event && eventModified(event)) { const url = `${location.pathname}/../${targetPanel}${location.search}`; navigateToLink(url, navigate, event); @@ -315,15 +321,43 @@ function BasePanelGroup({ localState.setLastUsedPanel(pageKey)(targetPanel); - // Optionally call external callback hook if (targetPanel && onPanelChange) { onPanelChange(targetPanel); } - // change dirty state setIsDirty(false); }, - [activePanels, navigate, location, onPanelChange] + [navigate, location, pageKey, onPanelChange] + ); + + // Callback when the active panel changes + const handlePanelChange = useCallback( + (targetPanel: string, event?: any) => { + cancelEvent(event); + + if (isDirty) { + modals.openConfirmModal({ + title: {t`Unsaved Changes`}, + children: ( + <> + + } + p='sm' + >{t`You have unsaved changes. Are you sure you want to leave this panel?`} + + ), + labels: { confirm: t`Leave`, cancel: t`Stay` }, + confirmProps: { color: 'red' }, + onConfirm: () => performPanelChange(targetPanel, event) + }); + return; + } + + performPanelChange(targetPanel, event); + }, + [isDirty, performPanelChange] ); // if the selected panel state changes update the current panel @@ -358,13 +392,6 @@ function BasePanelGroup({ }, [activePanels]); useInvenTreeHotkeys(hotkeys); - const [isDirty, setIsDirty] = useState(false); - useWindowEvent('beforeunload', (event) => { - if (isDirty) { - event.preventDefault(); - } - }); - return ( diff --git a/src/frontend/src/components/panels/ParametersPanel.tsx b/src/frontend/src/components/panels/ParametersPanel.tsx index 389a219d5e..17809fc376 100644 --- a/src/frontend/src/components/panels/ParametersPanel.tsx +++ b/src/frontend/src/components/panels/ParametersPanel.tsx @@ -1,23 +1,22 @@ -import { ApiEndpoints } from '@lib/enums/ApiEndpoints'; import type { ModelType } from '@lib/enums/ModelType'; -import { apiUrl } from '@lib/functions/Api'; import type { PanelType } from '@lib/types/Panel'; import { t } from '@lingui/core/macro'; import { Skeleton } from '@mantine/core'; import { IconListDetails } from '@tabler/icons-react'; -import { api } from '../../App'; import { ParameterTable } from '../../tables/general/ParameterTable'; export default function ParametersPanel({ model_type, model_id, hidden, - allowEdit = true + allowEdit = true, + parameter_count }: { model_type: ModelType; model_id: number | undefined; hidden?: boolean; allowEdit?: boolean; + parameter_count?: number; }): PanelType { return { name: 'parameters', @@ -25,21 +24,7 @@ export default function ParametersPanel({ icon: , hotkey: 'mod+Shift+P', hidden: hidden ?? false, - notification_dot: async () => { - if (!model_type || !model_id) { - return null; - } - - return api - .get(apiUrl(ApiEndpoints.parameter_list), { - params: { - model_type: model_type, - model_id: model_id, - limit: 1 - } - }) - .then((response) => ((response.data?.count ?? 0) > 0 ? 'info' : null)); - }, + notification_dot: parameter_count ? 'info' : null, content: model_type && model_id ? ( ): ReactNode { + return ( + instance && ( + + ) + ); +} diff --git a/src/frontend/src/forms/BuildForms.tsx b/src/frontend/src/forms/BuildForms.tsx index 8012bc44b8..0e1dccb8f6 100644 --- a/src/frontend/src/forms/BuildForms.tsx +++ b/src/frontend/src/forms/BuildForms.tsx @@ -139,7 +139,8 @@ export function useBuildOrderFields({ duplicate: DuplicateField({ originalId: duplicateBuildId, extraFields: { - copy_parameters: {} + copy_parameters: {}, + copy_notes: {} } }) }; diff --git a/src/frontend/src/forms/CommonForms.tsx b/src/frontend/src/forms/CommonForms.tsx index 1a646cf051..6baf6ca412 100644 --- a/src/frontend/src/forms/CommonForms.tsx +++ b/src/frontend/src/forms/CommonForms.tsx @@ -5,6 +5,7 @@ import { ApiEndpoints } from '@lib/enums/ApiEndpoints'; import { ModelType } from '@lib/enums/ModelType'; import { apiUrl } from '@lib/functions/Api'; import type { ApiFormFieldSet, ApiFormFieldType } from '@lib/types/Forms'; +import { t } from '@lingui/core/macro'; import type { StatusCodeInterface, StatusCodeListInterface @@ -305,6 +306,94 @@ export function useParameterFields({ ]); } +export function useNoteTemplateFields(): ApiFormFieldSet { + return useMemo(() => { + return { + template: { + hidden: true, + value: true + }, + model_type: { + label: t`Model Type`, + description: t`Limit this template to a specific model type, or leave blank for all models`, + required: false + }, + title: {}, + description: {} + }; + }, []); +} + +export function useNoteFields({ + modelType, + modelId +}: { + modelType: ModelType; + modelId: number; +}): ApiFormFieldSet { + const api = useApi(); + + const [title, setTitle] = useState(''); + const [description, setDescription] = useState(''); + const [content, setContent] = useState(''); + + const fetchTemplate = useCallback( + (pk: number | null) => { + if (!pk) return; + api + .get(apiUrl(ApiEndpoints.note_list, pk)) + .then((response) => { + setTitle(response.data.title ?? ''); + setDescription(response.data.description ?? ''); + setContent(response.data.content ?? ''); + }) + .catch(() => {}); + }, + [api] + ); + + return useMemo(() => { + return { + model_type: { + hidden: true, + value: modelType + }, + model_id: { + hidden: true, + value: modelId + }, + template_source: { + field_type: 'related field', + label: t`From Template`, + description: t`Optionally pre-fill this note from an existing template`, + model: ModelType.notetemplate, + api_url: apiUrl(ApiEndpoints.note_list), + filters: { + template: true, + model_type: modelType + }, + pk_field: 'pk', + required: false, + onValueChange: (value: any) => fetchTemplate(value), + value: null + }, + title: { + value: title, + onValueChange: (value: any) => setTitle(value) + }, + description: { + value: description, + onValueChange: (value: any) => setDescription(value) + }, + primary: {}, + content: { + hidden: true, + value: content + } + }; + }, [modelType, modelId, title, description, content, fetchTemplate]); +} + export function selectionListFields(): ApiFormFieldSet { return { name: {}, diff --git a/src/frontend/src/forms/CompanyForms.tsx b/src/frontend/src/forms/CompanyForms.tsx index bfd2ede4cc..4323a6b200 100644 --- a/src/frontend/src/forms/CompanyForms.tsx +++ b/src/frontend/src/forms/CompanyForms.tsx @@ -101,7 +101,8 @@ export function useSupplierPartFields({ duplicate: DuplicateField({ originalId: duplicateSupplierPartId, extraFields: { - copy_parameters: {} + copy_parameters: {}, + copy_notes: {} } }) }; @@ -146,7 +147,8 @@ export function useManufacturerPartFields({ duplicate: DuplicateField({ originalId: duplicateManufacturerPartId, extraFields: { - copy_parameters: {} + copy_parameters: {}, + copy_notes: {} } }) }; @@ -191,7 +193,8 @@ export function companyFields({ duplicate: DuplicateField({ originalId: duplicateCompanyId, extraFields: { - copy_parameters: {} + copy_parameters: {}, + copy_notes: {} } }) }; diff --git a/src/frontend/src/forms/PurchaseOrderForms.tsx b/src/frontend/src/forms/PurchaseOrderForms.tsx index fb5f9a9b06..fdf627f801 100644 --- a/src/frontend/src/forms/PurchaseOrderForms.tsx +++ b/src/frontend/src/forms/PurchaseOrderForms.tsx @@ -325,7 +325,8 @@ export function usePurchaseOrderFields({ }, copy_lines: {}, copy_extra_lines: {}, - copy_parameters: {} + copy_parameters: {}, + copy_notes: {} } }; } diff --git a/src/frontend/src/forms/ReturnOrderForms.tsx b/src/frontend/src/forms/ReturnOrderForms.tsx index f268b28d7a..41bd98ae8f 100644 --- a/src/frontend/src/forms/ReturnOrderForms.tsx +++ b/src/frontend/src/forms/ReturnOrderForms.tsx @@ -89,7 +89,8 @@ export function useReturnOrderFields({ value: duplicateOrderId }, copy_extra_lines: {}, - copy_parameters: {} + copy_parameters: {}, + copy_notes: {} } }; } diff --git a/src/frontend/src/forms/SalesOrderForms.tsx b/src/frontend/src/forms/SalesOrderForms.tsx index 6e9c955c56..71d0240a3f 100644 --- a/src/frontend/src/forms/SalesOrderForms.tsx +++ b/src/frontend/src/forms/SalesOrderForms.tsx @@ -103,7 +103,8 @@ export function useSalesOrderFields({ }, copy_lines: {}, copy_extra_lines: {}, - copy_parameters: {} + copy_parameters: {}, + copy_notes: {} } }; } diff --git a/src/frontend/src/forms/StockForms.tsx b/src/frontend/src/forms/StockForms.tsx index c79c5b4f26..79215f379a 100644 --- a/src/frontend/src/forms/StockForms.tsx +++ b/src/frontend/src/forms/StockForms.tsx @@ -34,6 +34,7 @@ import { IconChevronDown, IconChevronUp, IconCoins, + IconCopy, IconCurrencyDollar, IconLink, IconPackage, @@ -84,7 +85,7 @@ import { } from '../hooks/UseGenerator'; import useStatusCodes from '../hooks/UseStatusCodes'; import { useGlobalSettingsState } from '../states/SettingsStates'; -import { TagsField } from './CommonFields'; +import { DuplicateField, TagsField } from './CommonFields'; /** * Construct a set of fields for creating / editing a StockItem instance @@ -96,7 +97,8 @@ export function useStockFields({ create = false, supplierPartId, pricing, - modalId + modalId, + duplicateStockItem }: { partId?: number; locationId?: number; @@ -105,6 +107,7 @@ export function useStockFields({ create: boolean; supplierPartId?: number; pricing?: { [priceBreak: number]: [number, string] }; + duplicateStockItem?: any; }): ApiFormFieldSet { const globalSettings = useGlobalSettingsState(); @@ -331,6 +334,24 @@ export function useStockFields({ delete fields.serial_numbers; } + // Additional fields for stock item duplication + if (create && duplicateStockItem?.pk) { + fields.duplicate = { + icon: , + ...DuplicateField({ + originalId: duplicateStockItem.pk, + extraFields: { + copy_notes: { value: true }, + copy_history: { value: false }, + copy_tests: { + value: false, + hidden: !duplicateStockItem?.part_detail?.testable + } + } + }) + }; + } + return fields; }, [ stockItem, @@ -346,6 +367,7 @@ export function useStockFields({ purchasePriceCurrency, serialGenerator.result, batchGenerator.result, + duplicateStockItem, create ]); } diff --git a/src/frontend/src/forms/TransferOrderForms.tsx b/src/frontend/src/forms/TransferOrderForms.tsx index 2b7d52c502..34623b153d 100644 --- a/src/frontend/src/forms/TransferOrderForms.tsx +++ b/src/frontend/src/forms/TransferOrderForms.tsx @@ -59,7 +59,8 @@ export function useTransferOrderFields({ value: duplicateOrderId }, copy_lines: {}, - copy_parameters: {} + copy_parameters: {}, + copy_notes: {} } }; } diff --git a/src/frontend/src/hooks/UseInstanceInfo.tsx b/src/frontend/src/hooks/UseInstanceInfo.tsx new file mode 100644 index 0000000000..5cfbb40cd4 --- /dev/null +++ b/src/frontend/src/hooks/UseInstanceInfo.tsx @@ -0,0 +1,56 @@ +import { ApiEndpoints } from '@lib/enums/ApiEndpoints'; +import type { ModelType } from '@lib/enums/ModelType'; +import { apiUrl } from '@lib/functions/Api'; +import { useQuery } from '@tanstack/react-query'; +import { useApi } from '../contexts/ApiContext'; + +export interface InstanceInfo { + attachment_count: number; + note_count: number; + parameter_count: number; +} + +const emptyInstanceInfo: InstanceInfo = { + attachment_count: 0, + note_count: 0, + parameter_count: 0 +}; + +/** + * Fetch aggregated attachment/note/parameter counts for a single model instance. + * + * A single generic lookup which detail pages can use to drive their Attachments, + * Notes and Parameters tab notification dots from one request, instead of each + * tab independently querying its own list endpoint just to read a count. + */ +export function useInstanceInfo({ + modelType, + modelId +}: { + modelType?: ModelType; + modelId?: number; +}) { + const api = useApi(); + + const query = useQuery({ + queryKey: ['instance-info', modelType, modelId], + enabled: !!modelType && !!modelId, + // These counts only drive tab notification dots (not displayed as numbers + // anywhere), so - matching the staleTime PanelGroup already uses for the + // dots themselves - a stale value for a few minutes is an acceptable + // trade-off against refetching on every page navigation/remount. + staleTime: 5 * 60 * 1000, + queryFn: async () => { + return api + .get(apiUrl(ApiEndpoints.instance_info), { + params: { model_type: modelType, model_id: modelId } + }) + .then((response) => response.data ?? emptyInstanceInfo); + } + }); + + return { + instanceInfo: query.data ?? emptyInstanceInfo, + instanceInfoQuery: query + }; +} diff --git a/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx b/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx index 0048ad33f0..03fa7e4034 100644 --- a/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx +++ b/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx @@ -15,6 +15,7 @@ import { IconList, IconListDetails, IconMail, + IconNotes, IconPackages, IconPhoto, IconPlugConnected, @@ -73,6 +74,8 @@ const MachineManagementPanel = Loadable( lazy(() => import('./MachineManagementPanel')) ); +const NoteTemplatePanel = Loadable(lazy(() => import('./NoteTemplatePanel'))); + const ScimManagementPanel = Loadable( lazy(() => import('./ScimManagementPanel')) ); @@ -216,6 +219,13 @@ export default function AdminCenter() { content: , hidden: !user.hasViewRole(UserRoles.part) }, + { + name: 'notes', + label: t`Note Templates`, + icon: , + content: , + hidden: !user.isStaff() + }, { name: 'category-parameters', label: t`Category Parameters`, @@ -316,6 +326,7 @@ export default function AdminCenter() { 'selection-lists', 'parameters', 'category-parameters', + 'notes', 'location-types', 'stocktake' ] diff --git a/src/frontend/src/pages/Index/Settings/AdminCenter/NoteTemplatePanel.tsx b/src/frontend/src/pages/Index/Settings/AdminCenter/NoteTemplatePanel.tsx new file mode 100644 index 0000000000..f3640f47a9 --- /dev/null +++ b/src/frontend/src/pages/Index/Settings/AdminCenter/NoteTemplatePanel.tsx @@ -0,0 +1,15 @@ +import { t } from '@lingui/core/macro'; +import { Alert, Stack } from '@mantine/core'; +import { IconInfoCircle } from '@tabler/icons-react'; +import NotesEditor from '../../../../components/editors/NotesEditor'; + +export default function NoteTemplatePanel() { + return ( + + } title={t`Note Templates`}> + {t`Note templates can be used to create pre-defined notes which can be easily added to any model instance.`} + + + + ); +} diff --git a/src/frontend/src/pages/build/BuildDetail.tsx b/src/frontend/src/pages/build/BuildDetail.tsx index 0805fbcc49..9358562117 100644 --- a/src/frontend/src/pages/build/BuildDetail.tsx +++ b/src/frontend/src/pages/build/BuildDetail.tsx @@ -49,6 +49,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import useStatusCodes from '../../hooks/UseStatusCodes'; import { useGlobalSettingsState } from '../../states/SettingsStates'; import { useUserState } from '../../states/UserState'; @@ -231,6 +232,11 @@ export default function BuildDetail() { refetchOnMount: true }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.build, + modelId: build?.pk + }); + const buildPanels: PanelType[] = useMemo(() => { return [ { @@ -357,22 +363,25 @@ export default function BuildDetail() { }, ParametersPanel({ model_type: ModelType.build, - model_id: build.pk + model_id: build.pk, + parameter_count: instanceInfo.parameter_count }), AttachmentPanel({ model_type: ModelType.build, - model_id: build.pk + model_id: build.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.build, model_id: build.pk, - has_note: !!build.notes + note_count: instanceInfo.note_count }) ]; }, [ build, id, user, + instanceInfo, buildStatus, globalSettings, diff --git a/src/frontend/src/pages/company/CompanyDetail.tsx b/src/frontend/src/pages/company/CompanyDetail.tsx index d5c9c8d0e2..21c50c9514 100644 --- a/src/frontend/src/pages/company/CompanyDetail.tsx +++ b/src/frontend/src/pages/company/CompanyDetail.tsx @@ -41,6 +41,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import { useUserState } from '../../states/UserState'; import { AddressTable } from '../../tables/company/AddressTable'; import { ContactTable } from '../../tables/company/ContactTable'; @@ -80,6 +81,11 @@ export default function CompanyDetail(props: Readonly) { refetchOnMount: true }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.company, + modelId: company?.pk + }); + const detailsPanel = instanceQuery.isFetching ? ( ) : ( @@ -184,19 +190,21 @@ export default function CompanyDetail(props: Readonly) { }, ParametersPanel({ model_type: ModelType.company, - model_id: company?.pk + model_id: company?.pk, + parameter_count: instanceInfo.parameter_count }), AttachmentPanel({ model_type: ModelType.company, - model_id: company.pk + model_id: company.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.company, model_id: company.pk, - has_note: !!company.notes + note_count: instanceInfo.note_count }) ]; - }, [id, company, user]); + }, [id, company, user, instanceInfo]); const editCompany = useEditApiFormModal({ url: ApiEndpoints.company_list, diff --git a/src/frontend/src/pages/company/ManufacturerPartDetail.tsx b/src/frontend/src/pages/company/ManufacturerPartDetail.tsx index fdca15b137..26e1d6a97b 100644 --- a/src/frontend/src/pages/company/ManufacturerPartDetail.tsx +++ b/src/frontend/src/pages/company/ManufacturerPartDetail.tsx @@ -33,6 +33,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import { useUserState } from '../../states/UserState'; import { SupplierPartTable } from '../../tables/purchasing/SupplierPartTable'; import { StockItemTable } from '../../tables/stock/StockItemTable'; @@ -58,6 +59,11 @@ export default function ManufacturerPartDetail() { } }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.manufacturerpart, + modelId: manufacturerPart?.pk + }); + const panels: PanelType[] = useMemo(() => { return [ { @@ -102,19 +108,21 @@ export default function ManufacturerPartDetail() { }, ParametersPanel({ model_type: ModelType.manufacturerpart, - model_id: manufacturerPart?.pk + model_id: manufacturerPart?.pk, + parameter_count: instanceInfo.parameter_count }), AttachmentPanel({ model_type: ModelType.manufacturerpart, - model_id: manufacturerPart?.pk + model_id: manufacturerPart?.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.manufacturerpart, model_id: manufacturerPart?.pk, - has_note: !!manufacturerPart?.notes + note_count: instanceInfo.note_count }) ]; - }, [user, manufacturerPart]); + }, [user, manufacturerPart, instanceInfo]); const editManufacturerPartFields = useManufacturerPartFields(); diff --git a/src/frontend/src/pages/company/SupplierPartDetail.tsx b/src/frontend/src/pages/company/SupplierPartDetail.tsx index 3e7696d84a..23087de438 100644 --- a/src/frontend/src/pages/company/SupplierPartDetail.tsx +++ b/src/frontend/src/pages/company/SupplierPartDetail.tsx @@ -37,6 +37,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import { useUserState } from '../../states/UserState'; import { PurchaseOrderTable } from '../../tables/purchasing/PurchaseOrderTable'; import SupplierPriceBreakTable from '../../tables/purchasing/SupplierPriceBreakTable'; @@ -66,6 +67,11 @@ export default function SupplierPartDetail() { } }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.supplierpart, + modelId: supplierPart?.pk + }); + const panels: PanelType[] = useMemo(() => { return [ { @@ -119,19 +125,21 @@ export default function SupplierPartDetail() { }, ParametersPanel({ model_type: ModelType.supplierpart, - model_id: supplierPart?.pk + model_id: supplierPart?.pk, + parameter_count: instanceInfo.parameter_count }), AttachmentPanel({ model_type: ModelType.supplierpart, - model_id: supplierPart?.pk + model_id: supplierPart?.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.supplierpart, model_id: supplierPart?.pk, - has_note: !!supplierPart?.notes + note_count: instanceInfo.note_count }) ]; - }, [supplierPart]); + }, [supplierPart, instanceInfo]); const supplierPartActions = useMemo(() => { return [ diff --git a/src/frontend/src/pages/part/CategoryDetail.tsx b/src/frontend/src/pages/part/CategoryDetail.tsx index 57c73f19be..44aa24df6e 100644 --- a/src/frontend/src/pages/part/CategoryDetail.tsx +++ b/src/frontend/src/pages/part/CategoryDetail.tsx @@ -39,6 +39,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import { useStockAdjustActions } from '../../hooks/UseStockAdjustActions'; import { useUserSettingsState } from '../../states/SettingsStates'; import { useUserState } from '../../states/UserState'; @@ -80,6 +81,11 @@ export default function CategoryDetail() { } }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.partcategory, + modelId: category?.pk + }); + const stockOperationProps: StockOperationProps = useMemo(() => { return { refresh: refreshInstance, @@ -254,7 +260,8 @@ export default function CategoryDetail() { ParametersPanel({ model_type: ModelType.partcategory, model_id: category?.pk, - hidden: !id || !category.pk + hidden: !id || !category.pk, + parameter_count: instanceInfo.parameter_count }), { name: 'category_parameters', @@ -264,7 +271,7 @@ export default function CategoryDetail() { content: } ], - [category, id, partsView] + [category, id, partsView, instanceInfo] ); const breadcrumbs = useMemo( diff --git a/src/frontend/src/pages/part/PartDetail.tsx b/src/frontend/src/pages/part/PartDetail.tsx index 2bfcf93db9..8e0d1345b6 100644 --- a/src/frontend/src/pages/part/PartDetail.tsx +++ b/src/frontend/src/pages/part/PartDetail.tsx @@ -78,6 +78,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import { useStockAdjustActions } from '../../hooks/UseStockAdjustActions'; import { useGlobalSettingsState, @@ -182,6 +183,11 @@ export default function PartDetail() { refetchOnMount: true }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.part, + modelId: part?.pk + }); + const { instance: partRequirements, instanceQuery: partRequirementsQuery } = useInstance({ endpoint: ApiEndpoints.part_requirements, @@ -487,6 +493,7 @@ export default function PartDetail() { name: 'parameters', label: t`Parameters`, icon: , + notification_dot: instanceInfo.parameter_count ? 'info' : null, content: ( <> {lockingEnabled && part.locked && ( @@ -509,12 +516,13 @@ export default function PartDetail() { }, AttachmentPanel({ model_type: ModelType.part, - model_id: part?.pk + model_id: part?.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.part, model_id: part?.pk, - has_note: !!part?.notes + note_count: instanceInfo.note_count }) ]; }, [ @@ -525,7 +533,8 @@ export default function PartDetail() { userSettings, bomInformation, revisionSelector, - refreshInstance + refreshInstance, + instanceInfo ]); const breadcrumbs = useMemo(() => { diff --git a/src/frontend/src/pages/purchasing/PurchaseOrderDetail.tsx b/src/frontend/src/pages/purchasing/PurchaseOrderDetail.tsx index ae321be63f..5effc11264 100644 --- a/src/frontend/src/pages/purchasing/PurchaseOrderDetail.tsx +++ b/src/frontend/src/pages/purchasing/PurchaseOrderDetail.tsx @@ -34,6 +34,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import useStatusCodes from '../../hooks/UseStatusCodes'; import { useGlobalSettingsState } from '../../states/SettingsStates'; import { useUserState } from '../../states/UserState'; @@ -65,6 +66,11 @@ export default function PurchaseOrderDetail() { refetchOnMount: true }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.purchaseorder, + modelId: order?.pk + }); + const orderCurrency = useMemo( () => order.order_currency || @@ -198,16 +204,18 @@ export default function PurchaseOrderDetail() { }, ParametersPanel({ model_type: ModelType.purchaseorder, - model_id: order.pk + model_id: order.pk, + parameter_count: instanceInfo.parameter_count }), AttachmentPanel({ model_type: ModelType.purchaseorder, - model_id: order.pk + model_id: order.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.purchaseorder, model_id: order.pk, - has_note: !!order.notes, + note_count: instanceInfo.note_count, // TODO @matmair - change API to include a "locked" attribute that we can check here editable: order.status == poStatus.COMPLETE && @@ -216,7 +224,7 @@ export default function PurchaseOrderDetail() { : undefined }) ]; - }, [order, id, user]); + }, [order, id, user, instanceInfo]); const issueOrder = useCreateApiFormModal({ url: apiUrl(ApiEndpoints.purchase_order_issue, order.pk), diff --git a/src/frontend/src/pages/sales/ReturnOrderDetail.tsx b/src/frontend/src/pages/sales/ReturnOrderDetail.tsx index 6dfc0e742e..4a7ad11d99 100644 --- a/src/frontend/src/pages/sales/ReturnOrderDetail.tsx +++ b/src/frontend/src/pages/sales/ReturnOrderDetail.tsx @@ -34,6 +34,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import useStatusCodes from '../../hooks/UseStatusCodes'; import { useGlobalSettingsState } from '../../states/SettingsStates'; import { useUserState } from '../../states/UserState'; @@ -64,6 +65,11 @@ export default function ReturnOrderDetail() { } }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.returnorder, + modelId: order?.pk + }); + const roStatus = useStatusCodes({ modelType: ModelType.returnorder }); const orderOpen = useMemo(() => { @@ -150,19 +156,21 @@ export default function ReturnOrderDetail() { }, ParametersPanel({ model_type: ModelType.returnorder, - model_id: order.pk + model_id: order.pk, + parameter_count: instanceInfo.parameter_count }), AttachmentPanel({ model_type: ModelType.returnorder, - model_id: order.pk + model_id: order.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.returnorder, model_id: order.pk, - has_note: !!order.notes + note_count: instanceInfo.note_count }) ]; - }, [order, id, user]); + }, [order, id, user, instanceInfo]); const orderBadges: ReactNode[] = useMemo(() => { return instanceQuery.isLoading diff --git a/src/frontend/src/pages/sales/SalesOrderDetail.tsx b/src/frontend/src/pages/sales/SalesOrderDetail.tsx index 6cf14423db..ee7bbcce27 100644 --- a/src/frontend/src/pages/sales/SalesOrderDetail.tsx +++ b/src/frontend/src/pages/sales/SalesOrderDetail.tsx @@ -40,6 +40,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import useStatusCodes from '../../hooks/UseStatusCodes'; import { useGlobalSettingsState } from '../../states/SettingsStates'; import { useUserState } from '../../states/UserState'; @@ -73,6 +74,11 @@ export default function SalesOrderDetail() { } }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.salesorder, + modelId: order?.pk + }); + const orderCurrency = useMemo(() => { return ( order.order_currency || @@ -223,16 +229,18 @@ export default function SalesOrderDetail() { }, ParametersPanel({ model_type: ModelType.salesorder, - model_id: order.pk + model_id: order.pk, + parameter_count: instanceInfo.parameter_count }), AttachmentPanel({ model_type: ModelType.salesorder, - model_id: order.pk + model_id: order.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.salesorder, model_id: order.pk, - has_note: !!order.notes, + note_count: instanceInfo.note_count, // TODO @matmair - change API to include a "locked" attribute that we can check here editable: order.status == soStatus.COMPLETE && @@ -241,7 +249,7 @@ export default function SalesOrderDetail() { : undefined }) ]; - }, [order, id, user, soStatus, user]); + }, [order, id, user, soStatus, instanceInfo]); const issueOrder = useCreateApiFormModal({ url: apiUrl(ApiEndpoints.sales_order_issue, order.pk), diff --git a/src/frontend/src/pages/sales/SalesOrderShipmentDetail.tsx b/src/frontend/src/pages/sales/SalesOrderShipmentDetail.tsx index 44de746498..edf444da05 100644 --- a/src/frontend/src/pages/sales/SalesOrderShipmentDetail.tsx +++ b/src/frontend/src/pages/sales/SalesOrderShipmentDetail.tsx @@ -41,6 +41,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import { useUserState } from '../../states/UserState'; import SalesOrderAllocationTable from '../../tables/sales/SalesOrderAllocationTable'; import { SalesOrderShipmentDetailsPanel } from './SalesOrderShipmentDetailsPanel'; @@ -65,6 +66,11 @@ export default function SalesOrderShipmentDetail() { } }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.salesordershipment, + modelId: shipment?.pk + }); + const isPending = useMemo(() => !shipment.shipment_date, [shipment]); const isChecked = useMemo(() => !!shipment.checked_by, [shipment]); @@ -98,19 +104,21 @@ export default function SalesOrderShipmentDetail() { }, ParametersPanel({ model_type: ModelType.salesordershipment, - model_id: shipment.pk + model_id: shipment.pk, + parameter_count: instanceInfo.parameter_count }), AttachmentPanel({ model_type: ModelType.salesordershipment, - model_id: shipment.pk + model_id: shipment.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.salesordershipment, model_id: shipment.pk, - has_note: !!shipment.notes + note_count: instanceInfo.note_count }) ]; - }, [isPending, shipment]); + }, [isPending, shipment, instanceInfo]); const editShipmentFields = useSalesOrderShipmentFields({ pending: isPending, diff --git a/src/frontend/src/pages/stock/LocationDetail.tsx b/src/frontend/src/pages/stock/LocationDetail.tsx index bcaf1c08b3..e2dba4347e 100644 --- a/src/frontend/src/pages/stock/LocationDetail.tsx +++ b/src/frontend/src/pages/stock/LocationDetail.tsx @@ -45,6 +45,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import { useStockAdjustActions } from '../../hooks/UseStockAdjustActions'; import { useUserSettingsState } from '../../states/SettingsStates'; import { useGlobalSettingsState } from '../../states/SettingsStates'; @@ -101,6 +102,11 @@ export default function Stock() { } }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.stocklocation, + modelId: location?.pk + }); + const detailsPanel = id && instanceQuery.isFetching ? ( @@ -208,10 +214,11 @@ export default function Stock() { ParametersPanel({ model_type: ModelType.stocklocation, model_id: location.pk, - hidden: !location.pk + hidden: !location.pk, + parameter_count: instanceInfo.parameter_count }) ]; - }, [sublocationView, transferOrderView, location, id]); + }, [sublocationView, transferOrderView, location, id, instanceInfo]); const editLocation = useEditApiFormModal({ url: ApiEndpoints.stock_location_list, diff --git a/src/frontend/src/pages/stock/StockDetail.tsx b/src/frontend/src/pages/stock/StockDetail.tsx index 904551af81..a5d22d83b3 100644 --- a/src/frontend/src/pages/stock/StockDetail.tsx +++ b/src/frontend/src/pages/stock/StockDetail.tsx @@ -60,6 +60,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import { useStockAdjustActions } from '../../hooks/UseStockAdjustActions'; import { useGlobalSettingsState } from '../../states/SettingsStates'; import { useUserState } from '../../states/UserState'; @@ -112,6 +113,11 @@ export default function StockDetail() { defaultValue: {} }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.stockitem, + modelId: stockitem?.pk + }); + const showBuildAllocations: boolean = useMemo(() => { // Determine if "build allocations" should be shown for this stock item return ( @@ -307,12 +313,13 @@ export default function StockDetail() { }, AttachmentPanel({ model_type: ModelType.stockitem, - model_id: stockitem.pk + model_id: stockitem.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.stockitem, model_id: stockitem.pk, - has_note: !!stockitem.notes + note_count: instanceInfo.note_count }) ]; }, [ @@ -321,7 +328,8 @@ export default function StockDetail() { showInstalledItems, stockitem, id, - user + user, + instanceInfo ]); const breadcrumbs = useMemo( @@ -374,8 +382,9 @@ export default function StockDetail() { const duplicateStockItemFields = useStockFields({ create: true, - locationId: stockitem.location, - modalId: 'duplicate-stock-item' + modalId: 'duplicate-stock-item', + duplicateStockItem: stockitem, + locationId: stockitem.location }); const duplicateStockData = useMemo(() => { diff --git a/src/frontend/src/pages/stock/TransferOrderDetail.tsx b/src/frontend/src/pages/stock/TransferOrderDetail.tsx index 3863cee466..b1ccea9a0b 100644 --- a/src/frontend/src/pages/stock/TransferOrderDetail.tsx +++ b/src/frontend/src/pages/stock/TransferOrderDetail.tsx @@ -37,6 +37,7 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useInstance } from '../../hooks/UseInstance'; +import { useInstanceInfo } from '../../hooks/UseInstanceInfo'; import useStatusCodes from '../../hooks/UseStatusCodes'; import { useGlobalSettingsState } from '../../states/SettingsStates'; import { useUserState } from '../../states/UserState'; @@ -63,6 +64,11 @@ export default function TransferOrderDetail() { } }); + const { instanceInfo } = useInstanceInfo({ + modelType: ModelType.transferorder, + modelId: order?.pk + }); + const toStatus = useStatusCodes({ modelType: ModelType.transferorder }); const lineItemsEditable: boolean = useMemo(() => { @@ -174,18 +180,21 @@ export default function TransferOrderDetail() { }, ParametersPanel({ model_type: ModelType.transferorder, - model_id: order.pk + model_id: order.pk, + parameter_count: instanceInfo.parameter_count }), AttachmentPanel({ model_type: ModelType.transferorder, - model_id: order.pk + model_id: order.pk, + attachment_count: instanceInfo.attachment_count }), NotesPanel({ model_type: ModelType.transferorder, - model_id: order.pk + model_id: order.pk, + note_count: instanceInfo.note_count }) ]; - }, [order, id, user]); + }, [order, id, user, instanceInfo]); const orderBadges: ReactNode[] = useMemo(() => { return instanceQuery.isLoading diff --git a/src/frontend/tests/pages/pui_part.spec.ts b/src/frontend/tests/pages/pui_part.spec.ts index 961d0164d9..344f238293 100644 --- a/src/frontend/tests/pages/pui_part.spec.ts +++ b/src/frontend/tests/pages/pui_part.spec.ts @@ -1058,23 +1058,61 @@ test('Parts - Test Results', async ({ browser }) => { }); test('Parts - Notes', async ({ browser }) => { - const page = await doCachedLogin(browser, { url: 'part/69/notes' }); + const page = await doCachedLogin(browser, { url: 'part/71/details' }); - // Enable editing - await page.getByLabel('Enable Editing').waitFor(); + await loadTab(page, 'Notes'); - // Use keyboard shortcut to "edit" the part - await page.keyboard.press('Control+E'); - await page.getByLabel('text-field-name', { exact: true }).waitFor(); - await page.getByLabel('text-field-description', { exact: true }).waitFor(); - await page.getByLabel('tree-field-category').waitFor(); + // Expect to see notes rendered for this part + await page.getByRole('cell', { name: 'Red Widget' }).waitFor(); + await page.getByRole('cell', { name: 'Blue Widget' }).waitFor(); + await page.getByRole('cell', { name: 'Green Widget' }).waitFor(); + await page + .getByRole('link', { name: 'Read more in the documentation' }) + .waitFor(); + + // Let's try to create a new note, but cancel before submitting + await page.getByRole('button', { name: 'Add Note' }).click(); + await page.getByLabel('related-field-template').fill('instructions'); + await page + .getByRole('option', { name: 'Manufacturing Instructions' }) + .click(); + await page.getByText('Manufacturing Instructions').waitFor(); + await page.getByText('How to build this part').waitFor(); await page.getByRole('button', { name: 'Cancel' }).click(); - // Enable notes editing - await page.getByLabel('Enable Editing').click(); + // Enable editing for this note + await page.getByRole('button', { name: 'edit-note' }).click(); - await page.getByLabel('Save Notes').waitFor(); - await page.getByLabel('Close Editor').waitFor(); + await page.getByRole('button', { name: 'Bold' }).waitFor(); + await page.getByRole('button', { name: 'Italic' }).waitFor(); + await page.getByRole('button', { name: 'Underline' }).waitFor(); + await page.getByRole('button', { name: 'Heading 1' }).waitFor(); + await page.getByRole('button', { name: 'Heading 2' }).waitFor(); + await page.getByRole('button', { name: 'Heading 3' }).waitFor(); + + await page.getByRole('button', { name: 'finish-editing-note' }).click(); + + // Duplicate this part - should show options for copying notes + await page.getByRole('button', { name: 'action-menu-part-actions' }).click(); + await page + .getByRole('menuitem', { name: 'action-menu-part-actions-duplicate' }) + .click(); + await page + .getByRole('switch', { name: 'boolean-field-duplicate.copy_notes' }) + .waitFor(); + + // Generate random IPN for copying + const ipn = `IPN-${Math.floor(Math.random() * 100000)}`; + await page.getByRole('textbox', { name: 'text-field-IPN' }).fill(ipn); + await page.getByRole('button', { name: 'Submit' }).click(); + await page.waitForLoadState('networkidle'); + await page.getByText(`Part: ${ipn}`).waitFor(); + + // Check that the notes have been duplicated to this new part + await loadTab(page, 'Notes'); + await page + .getByRole('heading', { name: 'On Widgets (And Variants Thereof)' }) + .waitFor(); }); test('Parts - 404', async ({ browser }) => { diff --git a/src/frontend/yarn.lock b/src/frontend/yarn.lock index 7ed378cab8..8d4877221e 100644 --- a/src/frontend/yarn.lock +++ b/src/frontend/yarn.lock @@ -121,13 +121,13 @@ obug "^2.1.1" semver "^7.7.3" -"@babel/generator@^7.21.1", "@babel/generator@^7.29.7": - version "7.29.7" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.29.7.tgz#cca0b8827e6bcf3ba176788e7f3b180ad6db2fa3" - integrity sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ== +"@babel/generator@^7.21.1", "@babel/generator@^7.29.7", "@babel/generator@^7.29.8": + version "7.29.8" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.29.8.tgz#4b0b887885422643339e09022148a4c4ebaa4979" + integrity sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg== dependencies: - "@babel/parser" "^7.29.7" - "@babel/types" "^7.29.7" + "@babel/parser" "^7.29.8" + "@babel/types" "^7.29.8" "@jridgewell/gen-mapping" "^0.3.12" "@jridgewell/trace-mapping" "^0.3.28" jsesc "^3.0.2" @@ -287,10 +287,10 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz#bd87084ced0c796ec46bda492de6e83d29e89fc2" integrity sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg== -"@babel/helper-validator-identifier@^8.0.0": - version "8.0.2" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.2.tgz#5527f2e24e5a9f4de7426dca448031749691bb6f" - integrity sha512-9Fr9QeyCAyi1BR1jKZ6uYQ24EIhQUx5ReHfQU7drOE+TPOb+w11/dsqLkMOT2U29OdCT71XajrOT8xDc1C7orA== +"@babel/helper-validator-identifier@^8.0.0", "@babel/helper-validator-identifier@^8.0.4": + version "8.0.4" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz#60e427a9be7a101af52f14588def2dad8a9f9881" + integrity sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg== "@babel/helper-validator-option@^7.29.7": version "7.29.7" @@ -318,19 +318,19 @@ "@babel/template" "^8.0.0" "@babel/types" "^8.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.20.7", "@babel/parser@^7.22.0", "@babel/parser@^7.23.9", "@babel/parser@^7.29.7": - version "7.29.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.29.7.tgz#837b87387cbf5ec5530cb634b3c622f68edb9334" - integrity sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg== +"@babel/parser@^7.1.0", "@babel/parser@^7.20.7", "@babel/parser@^7.22.0", "@babel/parser@^7.23.9", "@babel/parser@^7.29.7", "@babel/parser@^7.29.8": + version "7.29.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.29.8.tgz#9653716a2f10c677b98fbc63d4bfb000c302cf17" + integrity sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA== dependencies: - "@babel/types" "^7.29.7" + "@babel/types" "^7.29.8" -"@babel/parser@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-8.0.0.tgz#31f6860840277dc1c6d6f8b67bf74e0ccaa5df0a" - integrity sha512-aLxAE+imI9bCcyaPrUDjBv3uSkWieifjLe0kuFOZF0zli0L6GCsTmsePnTr55adbIAgYz2zhN1vnFimCBUYcRQ== +"@babel/parser@^8.0.0", "@babel/parser@^8.0.4": + version "8.0.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-8.0.4.tgz#244e21ca23ab54c6f5373af2122cb3a618f9dd39" + integrity sha512-srpptsAkEbbNIC/q8nT7o+m6CQe8CJUTV/t7MYc9NnWlgYVtHOb7JH6SorxMhN0kuRJjVqXbKClG6xSbPtzz+g== dependencies: - "@babel/types" "^8.0.0" + "@babel/types" "^8.0.4" "@babel/plugin-syntax-jsx@^7.16.7": version "7.29.7" @@ -354,9 +354,9 @@ "@babel/helper-plugin-utils" "^7.29.7" "@babel/plugin-syntax-typescript@^8.0.1": - version "8.0.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-8.0.1.tgz#c02d0096b297bdd4dbd32b63dbac44c0f195b82f" - integrity sha512-YBpIeuOZSUZx7RGH/U+dIAsHDHyojBVDRHNBUgOiUDS5IIcgBm1uyu9xs/2kM27B/bmDfOxzJ9k8cU2QuOwGIA== + version "8.0.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-8.0.3.tgz#695e5768ff9f2f83289c6dee5b1dc734becd0c59" + integrity sha512-jmTPwps7oSQSZaV1SxkQ3C12UWyufGysGc5OzDpZzvPAIX4mO7dJT3hoqkWVrSImvkcMiknir1iLN1SNV/CZzg== dependencies: "@babel/helper-plugin-utils" "^8.0.1" @@ -477,46 +477,46 @@ "@babel/types" "^8.0.0" "@babel/traverse@^7.29.7": - version "7.29.7" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.29.7.tgz#c47b07a41b95da0907d026b5dd894d98de7d2f2d" - integrity sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw== + version "7.29.8" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.29.8.tgz#4111014cdc71a0f95d9471907590baa0b8a6b28a" + integrity sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg== dependencies: "@babel/code-frame" "^7.29.7" - "@babel/generator" "^7.29.7" + "@babel/generator" "^7.29.8" "@babel/helper-globals" "^7.29.7" - "@babel/parser" "^7.29.7" + "@babel/parser" "^7.29.8" "@babel/template" "^7.29.7" - "@babel/types" "^7.29.7" + "@babel/types" "^7.29.8" debug "^4.3.1" "@babel/traverse@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-8.0.0.tgz#0473589140c796d13e27641ab0783069f0fe7512" - integrity sha512-bxTj/W2VclGE6CctlfQOpxg8MPDzXArRqkOBePw8EHfebcjF7fETWSS3BriEECo+UiU/Yblq+xUtSImFu7cTbw== + version "8.0.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-8.0.4.tgz#71fc3f8861a4548e7f2938fdecac73e25d1db1ed" + integrity sha512-bZnmqzGG8UZneG1lLxBoWIH0G6Gr1D846Yu4/3XnY6FhCndMR49u26nTY08u/dAxWmLWF9vGQOuC+84FfIUoeg== dependencies: "@babel/code-frame" "^8.0.0" "@babel/generator" "^8.0.0" "@babel/helper-globals" "^8.0.0" - "@babel/parser" "^8.0.0" + "@babel/parser" "^8.0.4" "@babel/template" "^8.0.0" - "@babel/types" "^8.0.0" + "@babel/types" "^8.0.4" obug "^2.1.1" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.21.2", "@babel/types@^7.28.2", "@babel/types@^7.29.7": - version "7.29.7" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.29.7.tgz#8005e31d82712ee7adaef6e23c63b71a62770a92" - integrity sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.21.2", "@babel/types@^7.28.2", "@babel/types@^7.29.7", "@babel/types@^7.29.8": + version "7.29.8" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.29.8.tgz#1229eef31d85156d70fa3f4cd859376d0eaf6863" + integrity sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg== dependencies: "@babel/helper-string-parser" "^7.29.7" "@babel/helper-validator-identifier" "^7.29.7" -"@babel/types@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-8.0.0.tgz#b518f1ef7f9838bffdca4e123b449d3f644f4494" - integrity sha512-K8ponJDxBwDHigkeFqaqT5wLGl4bTlwMafR8k7b5CPxr6Ww+UG9ls8Yx6Tcpboxu97eeGVEEyKcHmEyOwN1vSw== +"@babel/types@^8.0.0", "@babel/types@^8.0.4": + version "8.0.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-8.0.4.tgz#8c208701320c9f0323b5b6a233d093e52c1e3b41" + integrity sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g== dependencies: "@babel/helper-string-parser" "^8.0.0" - "@babel/helper-validator-identifier" "^8.0.0" + "@babel/helper-validator-identifier" "^8.0.4" "@codecov/bundler-plugin-core@^2.0.1": version "2.0.1" @@ -549,12 +549,12 @@ "@lezer/common" "^1.0.0" "@codemirror/commands@^6.0.0", "@codemirror/commands@^6.1.0": - version "6.10.3" - resolved "https://registry.yarnpkg.com/@codemirror/commands/-/commands-6.10.3.tgz#01877060befdec352e8300dec1f185489c300635" - integrity sha512-JFRiqhKu+bvSkDLI+rUhJwSxQxYb759W5GBezE8Uc8mHLqC9aV/9aTC7yJSqCtB3F00pylrLCwnyS91Ap5ej4Q== + version "6.11.0" + resolved "https://registry.yarnpkg.com/@codemirror/commands/-/commands-6.11.0.tgz#2194d6fcad9ed787dcc42667db0e0543fab2e0ef" + integrity sha512-/K4Rl5BN0OtTiPWmJCdqODu38XnDMsDxKY5rgrPnCkutPTJf2wVbkoixLfealF5Kwse/s8P8M5jAiURiwSwnFA== dependencies: "@codemirror/language" "^6.0.0" - "@codemirror/state" "^6.6.0" + "@codemirror/state" "^6.7.0" "@codemirror/view" "^6.27.0" "@lezer/common" "^1.1.0" @@ -570,9 +570,9 @@ "@lezer/css" "^1.1.7" "@codemirror/lang-html@^6.0.0": - version "6.4.11" - resolved "https://registry.yarnpkg.com/@codemirror/lang-html/-/lang-html-6.4.11.tgz#c46ba46ae642fd567cf05c4129005d2913ac248d" - integrity sha512-9NsXp7Nwp891pQchI7gPdTwBuSuT3K65NGTHWHNJ55HjYcHLllr0rbIZNdOzas9ztc1EUVBlHou85FFZS4BNnw== + version "6.4.12" + resolved "https://registry.yarnpkg.com/@codemirror/lang-html/-/lang-html-6.4.12.tgz#ca5dc0f741c1e819182bce9d03b073552172b1b7" + integrity sha512-pw2ReWKUqSkbvh76RAT4NYxiogRu+PWkR2ukAwO9uOgrm8uipkzjtKKtNpyeAQwHOqxEeSvAXZ6vr3AfyB9y/w== dependencies: "@codemirror/autocomplete" "^6.0.0" "@codemirror/lang-css" "^6.0.0" @@ -763,176 +763,176 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz#5e13fac887f08c44f76b0ccaf3370eb00fec9bb6" integrity sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg== -"@esbuild/aix-ppc64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz#7a01a8d2ec2fbb2dac78adad09b0fa781e4082be" - integrity sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ== +"@esbuild/aix-ppc64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz#bf6e10303bcf2e7c686975fa52f937ec2728d8bc" + integrity sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ== -"@esbuild/android-arm64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz#b540a27d14e4afd058496a4dbec4d3f414db110a" - integrity sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg== +"@esbuild/android-arm64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz#0c6246bc8d2c4d172aac2db3fb1190d72bd65504" + integrity sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A== -"@esbuild/android-arm@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.28.1.tgz#704bd297de6d762de54eabbeafbf55f6756abe2f" - integrity sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ== +"@esbuild/android-arm@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.28.2.tgz#2d84ece6a4e2684d92be26ee13d42757d831c381" + integrity sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg== -"@esbuild/android-x64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.28.1.tgz#d1cb166d34b0fbf0fe8ab460a5594f24a378701e" - integrity sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng== +"@esbuild/android-x64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.28.2.tgz#fc38d4d6358d8dc1cf53f09f7589fe436eb64801" + integrity sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q== -"@esbuild/darwin-arm64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz#1034b26457fc886368fe61bbd09f653f6afa8e54" - integrity sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q== +"@esbuild/darwin-arm64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz#f83afeeac1d7dac01c7a2fd012b3e451a0591fcc" + integrity sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw== -"@esbuild/darwin-x64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz#65556a432a1e4d72032d8218c1932fcca1a49772" - integrity sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ== +"@esbuild/darwin-x64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz#510147c055a795588dbbe14fd6b1b8ad0a2f30de" + integrity sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw== -"@esbuild/freebsd-arm64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz#2e61e0592f9030d7e3dae18ee25ebc535918aef6" - integrity sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw== +"@esbuild/freebsd-arm64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz#093b9200ecf0b115ba4e5e248a7485c9c5f8bd5e" + integrity sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw== -"@esbuild/freebsd-x64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz#c95ec289959ef8079c4dca817a1e2c4be66b9bd3" - integrity sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ== +"@esbuild/freebsd-x64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz#0be22b6df925d213e841ea87123af5df80b0faf7" + integrity sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg== -"@esbuild/linux-arm64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz#40b22175dda06182f3ee8141186c5ff304c4a717" - integrity sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g== +"@esbuild/linux-arm64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz#1bdbc651cda9ba9995c53ed9c71ceaa65094762d" + integrity sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug== -"@esbuild/linux-arm@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz#c09a0f67917592ac0de892a9be4d3814debd2a6c" - integrity sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ== +"@esbuild/linux-arm@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz#beb12ad72b84f72d28488cc1b8ee9f7eb141d753" + integrity sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w== -"@esbuild/linux-ia32@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz#a580f9c676797833891e519fc7a1337c8afd8db3" - integrity sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w== +"@esbuild/linux-ia32@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz#b81f9d55529b45c206a46a138214b1aa6879696b" + integrity sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ== -"@esbuild/linux-loong64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz#46452cf321dc7f9e91c2fa780a56bb56e79cd68b" - integrity sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg== +"@esbuild/linux-loong64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz#598667241a04c99b76ed6ef940ac50038c419f98" + integrity sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ== -"@esbuild/linux-mips64el@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz#4211b3184dd6608f53dcb22e39f5d34ee08852c8" - integrity sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ== +"@esbuild/linux-mips64el@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz#1c51eb9cea903f53d97b5af3b1841db70f5596ca" + integrity sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA== -"@esbuild/linux-ppc64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz#697857c2a61cb9b0b6bb6652e40c1dc5e1ca8e5d" - integrity sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ== +"@esbuild/linux-ppc64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz#63dd61f17ceb31a81227f413feac8a71bc2c51f2" + integrity sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ== -"@esbuild/linux-riscv64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz#d192943eb146a40ac4c6497d0cf7be35b986bf08" - integrity sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ== +"@esbuild/linux-riscv64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz#3763b08fde5cf25ab1facb8e7752edfe45fbfc27" + integrity sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA== -"@esbuild/linux-s390x@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz#acea0356da0e0ebc08f97cf7b9c2e401e1e648dc" - integrity sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag== +"@esbuild/linux-s390x@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz#1a137ff293a82906eb3176385bd7e8e0e5cfb7cb" + integrity sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg== -"@esbuild/linux-x64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz#6f0c3ce0cb64c534b70c4c45ecb2c16d34e35dfd" - integrity sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA== +"@esbuild/linux-x64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz#268b36211c146ca54f8fe12c578a8d6ef8979485" + integrity sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ== -"@esbuild/netbsd-arm64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz#8bcd77077a0dce3378b574fedb26d2a253b73d36" - integrity sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw== +"@esbuild/netbsd-arm64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz#22571ad951d62bb6accc82d8d1fad5c8c1ac0ba1" + integrity sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw== -"@esbuild/netbsd-x64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz#e7fb2a01e99c830c94e6623cd9fefb4c8fb58347" - integrity sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg== +"@esbuild/netbsd-x64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz#42fcc57297eb0a0ca3f5fc475291f4c1a3f7c0de" + integrity sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw== -"@esbuild/openbsd-arm64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz#c52909372db8b86e2c55e05a8940033b5660a3b2" - integrity sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q== +"@esbuild/openbsd-arm64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz#9eb32af104ac3dacf4edca01f596664aab0c73ef" + integrity sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ== -"@esbuild/openbsd-x64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz#c427b9be5a64c262ff9a7eb70b5fbbaadf446c6c" - integrity sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw== +"@esbuild/openbsd-x64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz#febed2402d6088225e91f20fb4ce2522ad0a4efd" + integrity sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw== -"@esbuild/openharmony-arm64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz#dc9b147baca2e6c4b3c85571741ef4860a489097" - integrity sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg== +"@esbuild/openharmony-arm64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz#85641c3d466428bfbccea5f21c26836663fef5ce" + integrity sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q== -"@esbuild/sunos-x64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz#ce866d12df13c15e4c99f073a3d466f6e0649b3a" - integrity sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ== +"@esbuild/sunos-x64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz#a736f9d8962481045fc4c3e54f5479f22c870fb4" + integrity sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g== -"@esbuild/win32-arm64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz#7468e3692d01d629d5941e5d83817bb80f9e39b4" - integrity sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA== +"@esbuild/win32-arm64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz#ee5ab40fad186201b652a33f8a5eb149e9e42532" + integrity sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ== -"@esbuild/win32-ia32@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz#a5bc0063fb2bcab6d0ed63f2a1537958bc269ec6" - integrity sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg== +"@esbuild/win32-ia32@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz#c40d28a6d99a127da6711f2afd74b11cb63b06a7" + integrity sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA== -"@esbuild/win32-x64@0.28.1": - version "0.28.1" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz#10064ee44f4347b90c9a02b446bbf80a91632b12" - integrity sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A== +"@esbuild/win32-x64@0.28.2": + version "0.28.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz#b21affb804cc167c133d95f45b3a1dc1323b9a87" + integrity sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g== "@flakiness/playwright@^2.0.0": version "2.0.2" resolved "https://registry.yarnpkg.com/@flakiness/playwright/-/playwright-2.0.2.tgz#05370de2877cc86c1eb865ca4769a43092b4365f" integrity sha512-HYcItgyZQ10UwpCPdePZgxK6gP0ow26oQfqrH4vAJtmXrmsB9NP3yfY7D/5X0DkKAlR86QWX94Ql2nIsO5V+xQ== -"@floating-ui/core@^1.7.5": - version "1.7.5" - resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.7.5.tgz#d4af157a03330af5a60e69da7a4692507ada0622" - integrity sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ== +"@floating-ui/core@^1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.8.0.tgz#d01c0bbea02e4a57f6fd7d5de6fc2c5c7dca40e1" + integrity sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ== dependencies: - "@floating-ui/utils" "^0.2.11" + "@floating-ui/utils" "^0.2.12" -"@floating-ui/dom@^1.0.1", "@floating-ui/dom@^1.7.6": - version "1.7.6" - resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.7.6.tgz#f915bba5abbb177e1f227cacee1b4d0634b187bf" - integrity sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ== +"@floating-ui/dom@^1.0.0", "@floating-ui/dom@^1.0.1", "@floating-ui/dom@^1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.8.0.tgz#8a20e6facbe2456afdbeb6c8b968a72df689cf63" + integrity sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg== dependencies: - "@floating-ui/core" "^1.7.5" - "@floating-ui/utils" "^0.2.11" + "@floating-ui/core" "^1.8.0" + "@floating-ui/utils" "^0.2.12" -"@floating-ui/react-dom@^2.1.8": - version "2.1.8" - resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.1.8.tgz#5fb5a20d10aafb9505f38c24f38d00c8e1598893" - integrity sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A== +"@floating-ui/react-dom@^2.1.9": + version "2.1.9" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.1.9.tgz#f42a5f469ea56d6f2e2751efa1cf936243a87355" + integrity sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg== dependencies: - "@floating-ui/dom" "^1.7.6" + "@floating-ui/dom" "^1.8.0" "@floating-ui/react@^0.27.19": - version "0.27.19" - resolved "https://registry.yarnpkg.com/@floating-ui/react/-/react-0.27.19.tgz#d8d5d895b7cb97dac370bfbf55f3e630878fdf1f" - integrity sha512-31B8h5mm8YxotlE7/AU/PhNAl8eWxAmjL/v2QOxroDNkTFLk3Uu82u63N3b6TXa4EGJeeZLVcd/9AlNlVqzeog== + version "0.27.20" + resolved "https://registry.yarnpkg.com/@floating-ui/react/-/react-0.27.20.tgz#353664b4a2b329e9f91f8d9150f7992b5ace20f4" + integrity sha512-CMqMy7OaXl9W0eq1Uy7L7i2Y/anPvHmFmESd2CEw0t5YvZhcVCeo4MBevAmswRllX7Y2dEidA4ozGPunLSTQpw== dependencies: - "@floating-ui/react-dom" "^2.1.8" - "@floating-ui/utils" "^0.2.11" + "@floating-ui/react-dom" "^2.1.9" + "@floating-ui/utils" "^0.2.12" tabbable "^6.0.0" -"@floating-ui/utils@^0.2.11": - version "0.2.11" - resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.11.tgz#a269e055e40e2f45873bae9d1a2fdccbd314ea3f" - integrity sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg== +"@floating-ui/utils@^0.2.12": + version "0.2.12" + resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.12.tgz#afefe785949f16ac4cdd1e695935a321572dd56a" + integrity sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww== "@fortawesome/fontawesome-common-types@7.3.1": version "7.3.1" @@ -992,11 +992,6 @@ resolved "https://registry.yarnpkg.com/@github/webauthn-json/-/webauthn-json-2.1.1.tgz#648e63fc28050917d2882cc2b27817a88cb420fc" integrity sha512-XrftRn4z75SnaJOmZQbt7Mk+IIjqVHw+glDGOxuHwXkZBZh/MBoRS7MHjSZMDaLhT4RjN2VqiEU7EOYleuJWSQ== -"@isaacs/cliui@^9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-9.0.0.tgz#4d0a3f127058043bf2e7ee169eaf30ed901302f3" - integrity sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg== - "@istanbuljs/load-nyc-config@^1.0.0", "@istanbuljs/load-nyc-config@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -1054,9 +1049,9 @@ integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.5.0", "@jridgewell/sourcemap-codec@^1.5.5": - version "1.5.5" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" - integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== + version "1.6.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz#f4c663e862f06dc98ca4d453862c46902789a18d" + integrity sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw== "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.28": version "0.3.31" @@ -1072,9 +1067,9 @@ integrity sha512-sxQE460fPZyU3sdc8lafxiPwJHBzZRy/udNFynGQky1SePYBdhkBl1kOagA9uT3pxR8K09bOrmTUqA9wb/PjSQ== "@lezer/css@^1.1.0", "@lezer/css@^1.1.7": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@lezer/css/-/css-1.3.3.tgz#b9800a57b338985c34be0dcaa1638ddf5cba0df1" - integrity sha512-RzBo8r+/6QJeow7aPHIpGVIH59xTcJXp399820gZoMo9noQDRVpJLheIBUicYwKcsbOYoBRoLZlf2720dG/4Tg== + version "1.3.6" + resolved "https://registry.yarnpkg.com/@lezer/css/-/css-1.3.6.tgz#2cdae5b532beaa5cf1e7dccb918d8b190b6c6d14" + integrity sha512-YJE78Wcg+zX8f10hiHWQ4Az48Qr/c13eId0VtRQYLBpxHDmDeSrXIlkbl+fJGW42rWC/uoUco9mhBZeVWP/A1g== dependencies: "@lezer/common" "^1.2.0" "@lezer/highlight" "^1.0.0" @@ -1216,19 +1211,19 @@ "@lingui/core" "5.9.5" "@mantine/carousel@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/carousel/-/carousel-9.5.1.tgz#193aaa6fe743aa926a825450fd93d4b253bc3363" - integrity sha512-Q+VKHPDclHApVgNsOngs0LdZlcyXL5lmd4cvvLN1xwQA3bg3Qgw6Tuq/xLDOKl+C6VlxxwBwgDMQEzvP3Wuwjw== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/carousel/-/carousel-9.5.2.tgz#c15e81310876c7bb55036a1bc482cc45c96fad6d" + integrity sha512-4SQDgUJ/rAuFKi0XoOWDYP4dgPVYd3fz7dEU6lLcbxICxJ87Qr7aWhdn6xdjcdgW1IHFYQt88BrOi84n/Nq0zQ== "@mantine/charts@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/charts/-/charts-9.5.1.tgz#46ec2a39960756abbf0ac2eec0988b8d6580328a" - integrity sha512-JLa02nNyct+XVA3YSKGOVHoAMzO6Wg44uUB44SifDTejVFAiehHAM2GOcTqrYBAmYf/uodM/bdZktwNAug5irA== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/charts/-/charts-9.5.2.tgz#aa65d11bf24302f039d87bda5ea96c6bbab80edc" + integrity sha512-9+3Gdk3dw4o1pwhYMsNPhVkDzflVHfcdGJIQtBTCweeqOkJcytt++HlvmD/O3NW/hBEDUutR68mreHU+gH5SwA== "@mantine/core@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/core/-/core-9.5.1.tgz#954587a496244accf0b7d388f15b8e42dbcecfa2" - integrity sha512-3olDOYJBfW4kR37Aqdy/+FnYG7iNb5SPzOGeCp9dDxnt65K94sEqETDnXGJptOMO2xLm4KLJ/eBt3IIhJA7Z4Q== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/core/-/core-9.5.2.tgz#36baf9017388e1d522a2624edf051d0c9dfe00d3" + integrity sha512-yhnR+XVGmy7S66abvj/tF9SxzNJ+k60w+UZlC/vGOztrU2Cxpbr95gtrBrin4fpWyiE80qzVC2AY0WzaHPufWw== dependencies: "@floating-ui/react" "^0.27.19" clsx "^2.1.1" @@ -1237,67 +1232,77 @@ type-fest "^5.8.0" "@mantine/dates@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/dates/-/dates-9.5.1.tgz#7070d833baad311221bd7ef6cab9da5c3b5d7bbb" - integrity sha512-1FTIgF8L6AKEb+Ql53zVyCCp4JxvQp/AUDts5T/JEI7U0CZGpzg+FHGtmNShLR4ONuOfzOV1gkgU8INbxVJjag== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/dates/-/dates-9.5.2.tgz#a9eda1982b2760082d56ca3e40052af3818e0983" + integrity sha512-640r4aDYR7EfNV+qRqnIMC/HX0fuLiD8O4/qVVrLCgBV4w6ZtfcaTjLwDRR/F8uGIX5epNTujzhffz0n14HXCQ== dependencies: clsx "^2.1.1" "@mantine/dropzone@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/dropzone/-/dropzone-9.5.1.tgz#cde423945296ccd4a264756d003c3343298b02e6" - integrity sha512-KOHYV1GbFkczxEFMbUT3KyML0jSyh8xggLeasdPE24+YRB+Mt3sespMzbfc7sGpQctXoSAUgSeAz0deurvhzrw== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/dropzone/-/dropzone-9.5.2.tgz#f9300488dcd1afc3649cefcfa4e2b63bc21cc618" + integrity sha512-GKDWcJAMj+SU6QtI0lpvt6Y23atBVrgWAdUYyGSEP5lDomVa/dbarsy180hSdXR0JxeWUNpG9gbcgDxPSs1n0A== dependencies: react-dropzone "15.0.0" "@mantine/form@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/form/-/form-9.5.1.tgz#bfab7ec8a09c0e77ca3eebf84c68e15a2bab25d7" - integrity sha512-WsMZGBTsoG2Y/K+6QK0+GmsJxq5KzWHIzo65lRpkq/SwdenV9G+3m0LstlhI9i2/wQF83GfwP7mCbKMfzf00Eg== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/form/-/form-9.5.2.tgz#78d234f14d58d84d1c4cd405dcbcbcfb8f29148d" + integrity sha512-9zWyAvEIn5QGfDa7Mxf+iCeEnUHtIam2avY8Csx6PsHqWmRSl9eYfQFrofv6FcR6eAbVUzQHzL/gpqZ3BzPt9g== dependencies: "@standard-schema/spec" "^1.1.0" fast-deep-equal "^3.1.3" klona "^2.0.6" "@mantine/hooks@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-9.5.1.tgz#54b94e76ca957636d54cf764037408485a65a899" - integrity sha512-2sK9OdWvrzKBOuWxLfQA5qcAJzxpzqNlKumaP7Uq0i7LDBQeY/sYgNiBWLwtW+iZw6fFXwPf0nI7q5VVpvqnNQ== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-9.5.2.tgz#f8bb6dffcc62cf2adad8a01056f8d66ceb687f36" + integrity sha512-CsANdaF07VRhcvDCupIvAPtIqU1NxYSc+bhFCCasDHpgJOUQxmqeMOGCCGSjtOOEIs+E+pt2ZbbdfnygDYPybA== "@mantine/modals@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/modals/-/modals-9.5.1.tgz#ff2d36d001fe6c6b581796a08bc36a19f7ae4c3c" - integrity sha512-hvfNqwgiIxe/3sWPX5pIHzYnwV28U5w9UrA0Y+Dh3HDkmIu2PZ3nwcUhqS+Za6gFZCx53XuNLZs2OMW2hrvdzg== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/modals/-/modals-9.5.2.tgz#12ca29612f9812195f2a245fb377e84a5dfc9c10" + integrity sha512-mB+A9uk6U/1+e9khNCWrblE4cvrYA3H5eKp7iuz1KE472HXWp+A4h50Wb2WcN0FDIEU7+bTHWa167LUA/5jXwA== "@mantine/notifications@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/notifications/-/notifications-9.5.1.tgz#2a09c8027ec06365213869fadb3057d85df17e82" - integrity sha512-/MIGWag8U20HTM4gOGSNVhmQ0n6YM2gdSR1NbtBffSh77nuzwPjr68UmpMc2WHFMi8OBlrSIcw9Xpe3YPfgnvQ== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/notifications/-/notifications-9.5.2.tgz#cdd0daa8fcf9da751e0c7990fa694ee91bd305f4" + integrity sha512-2DQW2i6BlTGI7Vqp1a8IN03Q2CI/nMd7joJu7RGMTDhnnD0rhAhQtu/NwGdmq5gl4vFCpzzwHtH359Do2MlRGg== dependencies: - "@mantine/store" "9.5.1" + "@mantine/store" "9.5.2" react-transition-group "4.4.5" "@mantine/spotlight@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/spotlight/-/spotlight-9.5.1.tgz#8474b951aca217c026e109a82e768ff95c3bb758" - integrity sha512-fXiaFrlIjhoFh61IbM+tRP7mg1V20mSTVh2AJi4rm/BnoBvnd4fPw33Wdg+O3c5L9HGzPQdA9SHJ6rdDNueoRw== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/spotlight/-/spotlight-9.5.2.tgz#499ba5c035f2eee0fa414fb78ad0a3689b5062d4" + integrity sha512-+YrHe0pqGrx+sTZKSV9v2K/OMyBow4u1Id5zI4jevTGlENKFqsKPn94CIx6Ryn48ODFzJyiiAAXYmvRT4Sw3xA== dependencies: - "@mantine/store" "9.5.1" + "@mantine/store" "9.5.2" -"@mantine/store@9.5.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/store/-/store-9.5.1.tgz#873cf6350998ffb8cc96e97f32689def7a69f539" - integrity sha512-nDmA9S+qnQQ61KYgph06Wt2cx1tj3Z6eeyK3HvFeuLb5FcGycbITsVy/+3LltH2qdqkpNeAA9wQ926NFjn5hvA== +"@mantine/store@9.5.2": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/store/-/store-9.5.2.tgz#cf25c09ed51116b9cc8650fdd279a8e7816056f7" + integrity sha512-vpOS9QwqaJ1KOPr8MdQXYXFDIPkDg1KCr5O8FOGVZIGfsei1vvQsvvmMGGEKGmEE/4FCYwEfhCUWaAVw2psVzw== + +"@mantine/tiptap@^9.2.1": + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/tiptap/-/tiptap-9.5.2.tgz#1d8d4112ca9fbfc96d7092ec3a8df2abc1379470" + integrity sha512-8Bz0I0QQaEX/lYVwc/JGYJUJGndBgFdilHX6/XnsPLWWt9vhyYPXhb4JfVxFghbZn3TRLCykI8jasG9IojtIfA== + +"@mantine/utils@^6.0.22": + version "6.0.22" + resolved "https://registry.yarnpkg.com/@mantine/utils/-/utils-6.0.22.tgz#7eace697084e2bc5a831eb0fd7cbbc04cc1b0354" + integrity sha512-RSKlNZvxhMCkOFZ6slbYvZYbWjHUM+PxDQnupIOxIdsTZQQjx/BFfrfJ7kQFOP+g7MtpOds8weAetEs5obwMOQ== "@mantine/vanilla-extract@^9.2.1": - version "9.5.1" - resolved "https://registry.yarnpkg.com/@mantine/vanilla-extract/-/vanilla-extract-9.5.1.tgz#ff2ec93e53d7faff42c05d4207adea9918b75908" - integrity sha512-62r6hEuZ6Prt6bF8k1f2MnVXS6Jh1Z3cJnEi0nZ25wv70a4DJIHJnEEt+4jGD3POzrmo/wJHfXMEbNe0CAQp0g== + version "9.5.2" + resolved "https://registry.yarnpkg.com/@mantine/vanilla-extract/-/vanilla-extract-9.5.2.tgz#c3c2903c6b2618e40acb9bec9dc1f0d87fd1b6bc" + integrity sha512-+q/8OJucF/ZukBNFu2jEMtNqU6VhO15PnLnLd3CTZZnQYBMOOlUGVDKgRsMZk24Veygq2gYDkGLbNys4q9psrA== "@marijn/find-cluster-break@^1.0.0": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz#775374306116d51c0c500b8c4face0f9a04752d8" - integrity sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g== + version "1.0.4" + resolved "https://registry.yarnpkg.com/@marijn/find-cluster-break/-/find-cluster-break-1.0.4.tgz#42c2aea61cda307cdb1347444792452d7b5dbfb4" + integrity sha512-Wy0V7+SGUjnF9/TkiM1hKVDPj7jKXduPNboMVtHTA8dySMURWqfg/JZ9E2Sq8JgSJmkl7k7Qe9FLeMSrSraWmQ== "@messageformat/date-skeleton@^1.1.0": version "1.1.0" @@ -1327,33 +1332,33 @@ integrity sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w== "@octokit/core@^7.0.6": - version "7.0.6" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-7.0.6.tgz#0d58704391c6b681dec1117240ea4d2a98ac3916" - integrity sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q== + version "7.0.7" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-7.0.7.tgz#399ece485463ad927092404ff091aca09f46bb1d" + integrity sha512-DcB0M3KFgr9ECI328lhBMVsyFT2DnmNucSBTqEN3exyNKUzkkpUSCHmTRcunF41Eou2TIQKW4seewri8ON9bSA== dependencies: "@octokit/auth-token" "^6.0.0" - "@octokit/graphql" "^9.0.3" - "@octokit/request" "^10.0.6" - "@octokit/request-error" "^7.0.2" - "@octokit/types" "^16.0.0" + "@octokit/graphql" "^9.0.4" + "@octokit/request" "^10.0.13" + "@octokit/request-error" "^7.1.1" + "@octokit/types" "^17.0.0" before-after-hook "^4.0.0" universal-user-agent "^7.0.0" "@octokit/endpoint@^11.0.3": - version "11.0.3" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-11.0.3.tgz#acf5f7feddde4e12185d5312ee38ff77235d8205" - integrity sha512-FWFlNxghg4HrXkD3ifYbS/IdL/mDHjh9QcsNyhQjN8dplUoZbejsdpmuqdA76nxj2xoWPs7p8uX2SNr9rYu0Ag== + version "11.0.5" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-11.0.5.tgz#d7ec88843bfeeea692fee97b52e7c2cdc0393db4" + integrity sha512-iXa654H3yFafF/ieHkukfbgWo2rmXD2ceD0ZOtrPhw1bc3FDch1d9N/TNs0FQ1/cIbwb7kspUX8jzIs8nzb9DQ== dependencies: - "@octokit/types" "^16.0.0" + "@octokit/types" "^18.0.0" universal-user-agent "^7.0.2" -"@octokit/graphql@^9.0.3": - version "9.0.3" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-9.0.3.tgz#5b8341c225909e924b466705c13477face869456" - integrity sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA== +"@octokit/graphql@^9.0.4": + version "9.0.4" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-9.0.4.tgz#d1ec45fd6a0f95ba9270a6b4d2ce40762ee7de95" + integrity sha512-5s15CCiY8XXQ+FG+b1YQcl6Z2FA++nwAz/tg2VUrTmnMncP+2nnGUEYANImdnxsA2Fnq+Mbl7hDjUTw7cFAwcg== dependencies: - "@octokit/request" "^10.0.6" - "@octokit/types" "^16.0.0" + "@octokit/request" "^10.0.13" + "@octokit/types" "^17.0.0" universal-user-agent "^7.0.0" "@octokit/openapi-types@^27.0.0": @@ -1361,6 +1366,16 @@ resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-27.0.0.tgz#374ea53781965fd02a9d36cacb97e152cefff12d" integrity sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA== +"@octokit/openapi-types@^28.0.0": + version "28.0.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-28.0.0.tgz#a8e47691c1602f47764e7f15d165d6f66736b005" + integrity sha512-0rFyLuyHvIj6uuZWuDslxkowFYdPXoNIkeAv4b27dzm2Tf4vGWXnPsMcxs7d65kLdMERgP3wc1AEPlqMz8e1cQ== + +"@octokit/openapi-types@^29.0.1": + version "29.0.1" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-29.0.1.tgz#05895cc8ae328058e7af75b608c4c97f0bc1bc00" + integrity sha512-9qWOMFNxxLokERcms42rU0PTLqQmVs7g5E41TI4mCOxmpFayD1rfC7XxOL55cG9MBZLFlC31BrR37myMKardwg== + "@octokit/plugin-paginate-rest@^14.0.0": version "14.0.0" resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-14.0.0.tgz#44dc9fff2dacb148d4c5c788b573ddc044503026" @@ -1375,23 +1390,23 @@ dependencies: "@octokit/types" "^16.0.0" -"@octokit/request-error@^7.0.2", "@octokit/request-error@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-7.1.0.tgz#440fa3cae310466889778f5a222b47a580743638" - integrity sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw== +"@octokit/request-error@^7.1.0", "@octokit/request-error@^7.1.1": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-7.1.1.tgz#cd928d96355742853905be847bb7ab6ec6a7d518" + integrity sha512-+eaY7G2VVpSf2pc5Gn1+mph837V/d/TYTJAgWL9Tb0ogGYcpN3IlAVFgjL+Vv93F/sevrxkvsYCedtpLdcFLzA== dependencies: - "@octokit/types" "^16.0.0" + "@octokit/types" "^17.0.0" -"@octokit/request@^10.0.6", "@octokit/request@^10.0.7": - version "10.0.10" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-10.0.10.tgz#45e46934f3d772f006733be6b5ec18f22e54a00c" - integrity sha512-KxNC2pTqqhszMNrf12ZRd4PonRgyJdsM4F/jySiddQK+DsRcfBtUvqn8t7UsyZhnRJHvX46OohDt5N3VqIWC2w== +"@octokit/request@^10.0.13", "@octokit/request@^10.0.7": + version "10.0.15" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-10.0.15.tgz#20d76552bedec9785a1c0193b95550884782ba43" + integrity sha512-3CBg9aJ0hO9Pjyij8LbK/xYtEaPws9SW7xKz67daPNxQB1q5Y9OMA7DDOG0A6Hwf9ygGu3tvzusg0LXQ8/wAjA== dependencies: "@octokit/endpoint" "^11.0.3" - "@octokit/request-error" "^7.0.2" - "@octokit/types" "^16.0.0" - content-type "^2.0.0" - json-with-bigint "^3.5.3" + "@octokit/request-error" "^7.1.1" + "@octokit/types" "^17.0.0" + content-type "^3.0.0" + json-with-bigint "^3.5.12" universal-user-agent "^7.0.2" "@octokit/types@^16.0.0": @@ -1401,6 +1416,20 @@ dependencies: "@octokit/openapi-types" "^27.0.0" +"@octokit/types@^17.0.0": + version "17.0.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-17.0.0.tgz#c0fa4090b8d957dd9b65a511f71f87ee14037694" + integrity sha512-ByP1v7YL5SMveFPP7+sj0/ZuWCOOg/Chs4NafOMpq6WNIM/hdGY0S7C0TCGDBWu1aGmOxmUIhMx3cO+IdwYZ1Q== + dependencies: + "@octokit/openapi-types" "^28.0.0" + +"@octokit/types@^18.0.0": + version "18.0.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-18.0.0.tgz#763eeebafb488d8ea8a8322eafb2d9b1885d2844" + integrity sha512-l6bAF43PNxkJp6g+W4PjoUSSkxHomXw2nOum5CTftJz1NlV3vu93NImgOYtLf6CbBUb5j+fiuzW0PPQ5JTSvZA== + dependencies: + "@octokit/openapi-types" "^29.0.1" + "@playwright/test@^1.60.0": version "1.62.1" resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.62.1.tgz#68e1aaf6e480e1923936dee6c66fae1921d3a65a" @@ -1420,10 +1449,10 @@ redux-thunk "^3.1.0" reselect "^5.1.0" -"@remix-run/router@1.23.3": - version "1.23.3" - resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.23.3.tgz#957c098d4393d301a8aa7dccf3ef28ea5430e36a" - integrity sha512-4An71tdz9X8+3sI4Qqqd2LWd9vS39J7sqd9EU4Scw7TJE/qB10Flv/UuqbPVgfQV9XoK8Np6jNquZitnZq5i+Q== +"@remix-run/router@1.23.4": + version "1.23.4" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.23.4.tgz#d2becd2afca4a40c30a659d913b9b0bcc28bced8" + integrity sha512-q7j5geK7xs3UJSdm9/iytUNclBnLmYx1EnSeCFXHPeutdqgIMeFeHtUZgS3EhlKxdBEAu8OwtJCwmLrEzpSs7Q== "@rolldown/pluginutils@1.0.0-rc.3": version "1.0.0-rc.3" @@ -1439,199 +1468,199 @@ estree-walker "^2.0.2" picomatch "^4.0.2" -"@rollup/rollup-android-arm-eabi@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.4.tgz#2b86c8fff13a065845ddb65f64d814499ace020f" - integrity sha512-RrPokAb7dmbxFoeO3TloqHyOjgye8RkBhSqmp4aJMIex4c9r46ZstPnleDQOq1t46VOVjwIuwNogIqbodV1Vvg== +"@rollup/rollup-android-arm-eabi@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.63.1.tgz#d03ba6ea54f9ec80688d153763cd325a2d2a5af6" + integrity sha512-UZ8sUxPTiHWYX9QNdJedb1kDZSpS1t/VPWBWGSgqHNi9w3Cu6IXvu2mzbhiTiPvtrqgTQJ+zqiAq2iPIPilpaQ== -"@rollup/rollup-android-arm64@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.4.tgz#af217357ecc06ae5e4f54ef34ee72b1e37f8dbc3" - integrity sha512-JKuJc+pnpks2pjy7L/N3v/cAkZxYlnmuZoD840ldbMI5KDbC4iO9NKwPKYdjYFCMAIIlBzYSFHxIJVYzRo2/8A== +"@rollup/rollup-android-arm64@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.63.1.tgz#db5e36aa8a955b4b5e0b024d671230edc5cdc191" + integrity sha512-cQ4nFQABN5cDvDpbvJ7bMStCpnaVxynZrRMfUJYgxcIk9Sh54FIO1vtfkg0B69REjER77ioZ/ov+eAApx/KmLQ== -"@rollup/rollup-darwin-arm64@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.4.tgz#e9d0adba06e39b632fc8e880100ff06547eda80b" - integrity sha512-krw5uS2STmvJ02x0uTXHbqQNuz+9eZ1iw+qXk9dmW2gvV4jV7O2hEoOnuhFrpOPiel1mBFtqbxYZZtC46hXLOw== +"@rollup/rollup-darwin-arm64@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.1.tgz#1ed1c43922e7b9b5d020ef65d8402e3c81edc86e" + integrity sha512-FQNqd1lRy/0QhDk3xeRIkSBiCpXCiDnZO3YLVdcDKN1UBiKToNftCzcXYNLshmPDUMlu2TdeS8tGcsU6f3YF1Q== -"@rollup/rollup-darwin-x64@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.4.tgz#eff983a29db7d8ea7f733f1ce430fc64e159a5e6" - integrity sha512-wsTxtgApb4PrOsNJIm0FZ1h3WvCC+k9uxLJ4ad75hgoS4NiRes2SoJFlDAyMwiUY8IssDqGcHbXuN0sx1tfF1A== +"@rollup/rollup-darwin-x64@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.63.1.tgz#0a86e782bf7a546e74f531e395e24fdb45c83527" + integrity sha512-pvD16V939D3CloK0+qikpGaxiPrDUXTe7Y5cWOMkMSy7m1cawa8EGy/kXYi/G/cKAC4HDAbSnzCIk1WmsoOKXg== -"@rollup/rollup-freebsd-arm64@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.4.tgz#abe1399a70e819034f492d05dbcc97964310bb57" - integrity sha512-GUOnQlyZe3yAXhWOtOMsn5Qkrv5E5mZXa0thbARWi5Ei2szlVXJFQhddZ4HbAzh8q92w5twp+CQvs/eFanz9YQ== +"@rollup/rollup-freebsd-arm64@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.63.1.tgz#82fa51c540185b5063c8b3c63aac79b15f2801ad" + integrity sha512-pcFGeL2345VwdTnJhA6zLbew+YgWB0qBG2+dMtXjCicf6+rm6kO6cOoh5VnTe0ZMrMRgRyuHmCJxZWrIdzYuOw== -"@rollup/rollup-freebsd-x64@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.4.tgz#b2e0f8c24a362ac7112be3d5549c6940597e0168" - integrity sha512-/Y7f3QuxjzPKsjA/rfEDa3+0vXqyjmJ50Ln8dPpCmWkKTrUoWHG1cWhTqaAMLob2m2nESWuC7yGrREz019Ztqg== +"@rollup/rollup-freebsd-x64@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.63.1.tgz#df1d73b567fd62e0cf21c9b57dff7f44bfd69638" + integrity sha512-mRJlqSRulVzcKq/LKA6ICSIc3K/l4fzlVn/gePn2nXIHy8seRi5z/eeRE0d/XMBxcMldiXtQTSpRj0tkkC3g8Q== -"@rollup/rollup-linux-arm-gnueabihf@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.4.tgz#a5f2a7e7eb719254a6800db18e9f369d3c623439" - integrity sha512-81wiiX3v7aqy+T+bT61TJ78yJjRquqFFTTbAPt08imfQQzkPIW8t6aJbkTagtCCrXMNc9D66+geqlK7ydLPNqA== +"@rollup/rollup-linux-arm-gnueabihf@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.63.1.tgz#a585ba0418027a5b567693db3982e5e57544a4c7" + integrity sha512-YDUNvVM85TI3g/1OpnqKP1h4NeW/j64DfWMf+G3M809xNk1bJSnpFp4sh83NpmVE5DXnkh8ULor4LTVZKoYLHw== -"@rollup/rollup-linux-arm-musleabihf@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.4.tgz#390c86c797695af87c38d6f005222d920b5bfa22" - integrity sha512-9kmDIvNZqdoHOBZgNtpTBeLWYO/LVipM3H/j62P8848/l/VPEQL6N3uxU9pvP1oZAsXyC2MEnFP3ovRjo7WYNQ== +"@rollup/rollup-linux-arm-musleabihf@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.63.1.tgz#1326f0db22b690a92efd8eaa06e92268dc7d1bb6" + integrity sha512-7Mcn71p9ZuQFAj+h+dhQXy/yeLePRS2yKRnmW1DijA9thKO5qap0GNOIQK4yQ6iP3SU0Mrb/yWo8h8vgRba8lw== -"@rollup/rollup-linux-arm64-gnu@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.4.tgz#1fea78609a15813cda98d93fe8d987c87017f572" - integrity sha512-CcnXHWnXg69g+DX5VWL3FHts3qMRN2uVEHX+BZvGLdd07/gXkn3ePjYtO1LDJvxkGKVHMclKBRa1QUTH+6toYQ== +"@rollup/rollup-linux-arm64-gnu@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.63.1.tgz#9491939f7cc43a5b26a877417faeafe69bac79ac" + integrity sha512-4YiLQTX6U4CSl0L9cluep9A9W6UmTfqBDc2/CH6wlu54pl4E7Jn3cOD8oxzvBDEGk/JMKgJ47C8g+radF7mwvg== -"@rollup/rollup-linux-arm64-musl@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.4.tgz#3b50031c9916517576098f6e11b38a13147dc463" - integrity sha512-iFOibiHnTRuhrWLlRsOQFdZJJIa7S8OwkneJr4ocALP16u5yk6lWLINFwhHaEqBFMsKDUZofLkGos7+CPzGB3g== +"@rollup/rollup-linux-arm64-musl@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.63.1.tgz#a53d93dac32acc671324af1153930ab5a04d8639" + integrity sha512-2ra8F7w8OquwZN9z2/fKFnli69wa8PLwaVzRMIPGb13ByMJwC28Fbp8YcVGoUhlYMTt7j5j9bNgpysrN2UM+vw== -"@rollup/rollup-linux-loong64-gnu@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.4.tgz#b403255546099a4300b17d976ee1776224c090e5" - integrity sha512-XnWYMI7euHlb5a871xPja+Gm7DRCFU+FGRrtS2sMq9N8FvqtpagUy6gD4YOemC5MRk9xbh8+jYMEJbigFQwsgA== +"@rollup/rollup-linux-loong64-gnu@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.63.1.tgz#db6e06173efc870be49a2df692d0c0607417a679" + integrity sha512-Sy20ncyhjmBP0Ml+UvQbimjlk6VFgjW5uNP+qqwHB00mTE8Bl2C1TuHTlRwK2YoXeZbee5lP2XevBWVkAQAtSQ== -"@rollup/rollup-linux-loong64-musl@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.4.tgz#5900610e59c66ee594539c6590566dbfda7082b1" - integrity sha512-qGDAlO0U8xedCcsdRm9oaoQY8DAx/QT7uIxJWhCdx0ceIWX783UC9QSYkdpzAe29wNiVfp24+bZdQmn49o45SQ== +"@rollup/rollup-linux-loong64-musl@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.63.1.tgz#a60734a3de407bcf4bfe44d0b64222c0b9fb30bc" + integrity sha512-noITLp8oNjYliPnGWmLyelIHwULGqbHloQHGw1rtxbWhTuWooRpnZarZQJ1y9EUC4szuCusCc+HEpUtxpIwYvA== -"@rollup/rollup-linux-ppc64-gnu@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.4.tgz#a892cc8b8414bc8ae0b267816b5e384e5d321ff2" - integrity sha512-ru4H6ezD7ysA5EiEK6qkkaEb4modH8CTej6kUy/gQi20u3kB3G7Zn8snXXkeJSCOFKG/rbPPtM/+9Wgas1961w== +"@rollup/rollup-linux-ppc64-gnu@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.63.1.tgz#28a67e15d7ba8630ef044980a39626e0627d6e73" + integrity sha512-hlxxXd+F1mWiAcaFR7Sv9ZQT6m6UfI8+Vy/kFJzztq2pDMU/0wZ9sish0iszNZvsQDo8Gc0i5yuFEOz5dDf6fA== -"@rollup/rollup-linux-ppc64-musl@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.4.tgz#d9e60d568b7db4df2196fb2411b0c6918b2360cc" - integrity sha512-2W4MO5WQVJnbJaZdvDb9rhBDuFU1nKIepPFpJUBsTh2k1YY2g+ODViaWuyOAjQ5cOP7NvrvLzt3wvHOoiAvc7w== +"@rollup/rollup-linux-ppc64-musl@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.63.1.tgz#77bb553a514942af54070756763dbb44c9c6cb2b" + integrity sha512-EF7OpqQTQ/BvGqLzUi4rEHuagCV9MugAUXSHemwPW5vxZ75RR+jxO/2j95Ph2dalMpFHSVECjRoioHZgA9zOYA== -"@rollup/rollup-linux-riscv64-gnu@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.4.tgz#5b3141ab43afbd9e50f639e562e94ed256d201cf" - integrity sha512-+fxjfuoAmVMCYV5QyjoIpu0cp5DOiOTeqYFk1AVaxGr+/ravWLX89XfQmptsoWcaVy/TGf2hexzbUOrCQIL1CQ== +"@rollup/rollup-linux-riscv64-gnu@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.63.1.tgz#ef9f31b917e3b310eac5b86d3b6626df7e543e3d" + integrity sha512-wQO3JesW9PRkwlabQ27y7sPfVOOTLRG73I4F2UYHG5PXun3J9U3y+b7ezVKSYbsvSKGQ1k1cq8Qlun4C9kLt3w== -"@rollup/rollup-linux-riscv64-musl@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.4.tgz#b0fe751015bc3822f9004884eaba5e5cdfde7aa6" - integrity sha512-jTn8JfHGL4djjFxPuM06LmNUJDsst2jeVlsd9OmIH6zc5sC9K6rIuO4YajXatLUpBmBKl6b35ro1QZocLi+tcA== +"@rollup/rollup-linux-riscv64-musl@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.63.1.tgz#68cf61a2fc02171d1fa62568b73c1d942f82e80c" + integrity sha512-ouAGwhO6wHRXdnOVCOsB0tRFkA7nhNB2Nwax6oECXN0YiN8EYUTBAOudADOB1PI+yDL61TeNx/u7MVCzksNbkQ== -"@rollup/rollup-linux-s390x-gnu@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.4.tgz#0cb323e850509e1b9bf6d241328a98b0e12e2916" - integrity sha512-oCJCJL4pXsoDcP2QZ+JVlPTIRc6266zsIaeJJsWImmF7HO0W8nb6HuSgZlMWxJwaPf8ehbSw8yo0EUw925hKsA== +"@rollup/rollup-linux-s390x-gnu@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.63.1.tgz#92d393ca47da0d03d1c1cffb3d7340f26c3a53d2" + integrity sha512-q2R38Sn+1J8RxhfJ+T54wSWmyKXWec+9jgDfqO2AtArEqHO5R2aeayp5H5OYLr5UYDVGsVaZPEFUooMhYCdz5A== -"@rollup/rollup-linux-x64-gnu@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.4.tgz#1e7470123e7a8ba8c160a7a043447472d5549542" - integrity sha512-W69hukhZ3KKNRCaMIEzKvcFye42hh0FE1+YoYaf5+Ikacuftoco6yO/xouz0hc5d5W/s3yBro5jRiuEE/Q5vUw== +"@rollup/rollup-linux-x64-gnu@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.63.1.tgz#f6e5c5c51f96ae298617fa26da54675acd60e3bc" + integrity sha512-gfI5T24WLLuFfSKw7Go/zDXjAAV0fny0swTaDv+WjK7vqcw4cRhFfdsyKL1n+ukI+ooBxn3bVQnyrn06WpI50w== -"@rollup/rollup-linux-x64-musl@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.4.tgz#19df9a17d20ff3c17bd8e9cc2553563ae0aa0580" - integrity sha512-qiXbGG2jkjXhzXpsFZSR2Xpb8DN/UaxYsbb/STbuR/6fpaDgRmmaq1B/LmtF2wQFOFOSsK2jdE0RZ3a0zHn4QA== +"@rollup/rollup-linux-x64-musl@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.63.1.tgz#227a949c481909c781d8a39c280f75553cdd16bc" + integrity sha512-4h6XqthmB4Hspji84wvgk+ElodTsGj+dbZqHJHHtKxj4mYq0ANSEEPX9ys3moJueqsRjwpaJYH7874Itwnj2ow== -"@rollup/rollup-openbsd-x64@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.4.tgz#31c3ca1bd00e80f309a1d0cb8da4bdf59cb2dfa3" - integrity sha512-nWeM//hxv8mIo6jD7Hu4o48DVmV9pbV6gsKaWU+4NFyqHoPKwrkRiZGLKUhOBk8qNmDmpwFtPKg80Bo/Tn4xiQ== +"@rollup/rollup-openbsd-x64@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.63.1.tgz#f57241ebdb73d3bc236e7b1252988408b2139c13" + integrity sha512-dlfCOa87o1VAYegLQ9EKilx2JCeRofiyPGhTCmqnuXZ6bMPiycO1rq1+sKoulAp7pGLIsTIw+1x5R+zgh5LhhA== -"@rollup/rollup-openharmony-arm64@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.4.tgz#84561a14381caecb7652e158d10551a5edc0a6fc" - integrity sha512-s62SQ/vgsRSvMwDkOEfTqfgASF0f26ZNaQuTA6Aok5lrikf89yI2W0gFHvZb2Jpgc6N8JnOKZgCK2iciO3CsxQ== +"@rollup/rollup-openharmony-arm64@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.63.1.tgz#3a9ffe5af71e8316dd2716b57dd64287a8c1fa0b" + integrity sha512-cjkLbOlfcm3QGhMM1J5zaZjsw1GggbN6rw9UTSSRrPrR1KkcXnN7Uq9rPw34xImQ9VOY9GN+6u2Zj80B9ptkcw== -"@rollup/rollup-win32-arm64-msvc@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.4.tgz#bc532edb20cd39c0b53eee2dfae43b52c2e3be1e" - integrity sha512-J6wGf8TVGbXJq+HH+ttTvrcfNKPbuZecV6KT1B8I18BC5IURUh5kl4Yl5OEP5eFIUoI5BWxCsyYMhFsDx8kekw== +"@rollup/rollup-win32-arm64-msvc@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.63.1.tgz#7d4a40396ae79ebc1e3636c1d566c7d1838b800c" + integrity sha512-Li1KdUnWGE4N3e1F/B4RTB1ms+nG4WBgjByO46pkeBVX/2UBsY53xf5vK9WygVmnH3RwncIST7lkSdLSY6P9lg== -"@rollup/rollup-win32-ia32-msvc@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.4.tgz#a6f51492976c9fc19801be298df2f76a3cbebf7a" - integrity sha512-zmfrQd/0wu6oJs8Vq8KwY/YtsKSsLtKe/HwAP4Wqy8LhWjeT55fHRAkOhYQ12wI3ayS4Tt12d5CDRD7N96SAYQ== +"@rollup/rollup-win32-ia32-msvc@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.63.1.tgz#f234ab80141da45ebe85727f714eb20de2e72c2a" + integrity sha512-t4ZYOSoLTgwhuFMrmTMLx/+i1DQVK7HYqMc6kY46EApwi8X0nIVphzdNoThU3xt6n+N5urG1/gxBdCaKDLavfg== -"@rollup/rollup-win32-x64-gnu@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.4.tgz#ae60710b0868b2fe731d9f7c341fa49cbf8e8629" - integrity sha512-qPzHqdj9rfUD+w79dtE07zi/kFwKyCJqplp5K5ygeLTp7jLpAoc16OAH39HSmRC9UpozaecsleI8uAdEj6v2yw== +"@rollup/rollup-win32-x64-gnu@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.63.1.tgz#5d5a664c23c8ff0526b9abd703b50ffe09703c2a" + integrity sha512-RgroPfMmKlD1RzSDxvwgcPiy2HNQKoYV7OmwIXDsk73uKW5t6B/V8KIy27SMv/FNXFo/oSBtWc9J0X7t91ezZg== -"@rollup/rollup-win32-x64-msvc@4.62.4": - version "4.62.4" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.4.tgz#c3a265fe0f9af4fb63bad86d3829386bc5da0026" - integrity sha512-zD6NdeWEByGE9QF9vCrlJ5YQB4oq9q91kPZS37Jwj5hOkvR1lTBSpsKhKDw4IJtbQ35LsTS1HD9DZYGKIshU1Q== +"@rollup/rollup-win32-x64-msvc@4.63.1": + version "4.63.1" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.63.1.tgz#cd19d691330cbd52ebb13620acb6cf7140b95e80" + integrity sha512-at8QVep6S3h5Y6gSbdGU06bRY5WJkf6WUduM9YtvYMbYhB1MOFfUgc6kehitQXzOtMSaT70q7f9ydPhpqu821w== -"@sentry/browser-utils@10.70.0": - version "10.70.0" - resolved "https://registry.yarnpkg.com/@sentry/browser-utils/-/browser-utils-10.70.0.tgz#277a78d6162bd5dfca9846c727598471e7dc0186" - integrity sha512-IvjhafF5NFXrPCg5EHbAPGDwIhHxgUcLlHTklZ3DAdA6ky88BJYMfevbcnOEmgavf4nylhCaquRUFNB5+szj+A== +"@sentry/browser-utils@10.72.0": + version "10.72.0" + resolved "https://registry.yarnpkg.com/@sentry/browser-utils/-/browser-utils-10.72.0.tgz#0037942e3f41ad06e29dd29f1363b40a26c59436" + integrity sha512-aZyogxXnNgDRupNscB8VEZdJbhbIk0+LiXrg5Fl82foGlcc5I22GdxORSb/JHwkeMFttZmvh1/OMwSPzAmE94Q== dependencies: "@sentry/conventions" "^0.16.0" - "@sentry/core" "10.70.0" + "@sentry/core" "10.72.0" -"@sentry/browser@10.70.0": - version "10.70.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-10.70.0.tgz#0305d0a1a644d4878b31a83934c656a0ce5f84c6" - integrity sha512-IK6+J+8H06tZe+A8L37TT5ZxxwNtyQatW8zl5RYYJ/e9CsjrM8fPi8I1OT7uquTw8UtjqFHt7bEef/Vy63ksPg== +"@sentry/browser@10.72.0": + version "10.72.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-10.72.0.tgz#d16cb66722d2493176cb25320aa57409d9ae4c8d" + integrity sha512-pbXHaovq/rRO5wsHz6Yey6SBPJLrbi7kCaYlSr6+v4bB4UoIL5dFB65BcQ7XD3BzZDNNvl6jTe68a1/sUMb5oA== dependencies: - "@sentry/browser-utils" "10.70.0" + "@sentry/browser-utils" "10.72.0" "@sentry/conventions" "^0.16.0" - "@sentry/core" "10.70.0" - "@sentry/feedback" "10.70.0" - "@sentry/replay" "10.70.0" - "@sentry/replay-canvas" "10.70.0" + "@sentry/core" "10.72.0" + "@sentry/feedback" "10.72.0" + "@sentry/replay" "10.72.0" + "@sentry/replay-canvas" "10.72.0" "@sentry/conventions@^0.16.0": version "0.16.0" resolved "https://registry.yarnpkg.com/@sentry/conventions/-/conventions-0.16.0.tgz#3b58d15714cf44dca1518496c00749eec5525009" integrity sha512-fO9PLmHdVURcSPUpWCItWAtgKiMwGdJHbovoSEyLplX5sxs2ugvI4CBPTrkkgqhObnZOD0CnWBKDzSVQYBKEyQ== -"@sentry/core@10.70.0": - version "10.70.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-10.70.0.tgz#96eb9f2beab7d4b3b10c1b59ec7833e4dfe5fb73" - integrity sha512-ozhCTDqg89oB4XmWfAwuHshABpvT7AkRpaPnogopPfMAaI61G1t8EKCJ4W7aum8JSBonlfyjPCyW5oYZFm0KvA== +"@sentry/core@10.72.0": + version "10.72.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-10.72.0.tgz#0b6aa84b75199f6a90ca7b215a569a5527d55fe7" + integrity sha512-UJMHZfbjP4qk+g4AQhZmzosMdICC2D9p0/hLrm1LofPsp+WBfcSnv9jsY1a9TfmpS4WCAmTx8nANYTIXifcBjA== dependencies: "@sentry/conventions" "^0.16.0" -"@sentry/feedback@10.70.0": - version "10.70.0" - resolved "https://registry.yarnpkg.com/@sentry/feedback/-/feedback-10.70.0.tgz#72b3f390f296982f9822aa372686b777ab955f17" - integrity sha512-6VQn2ETJjHkk4QQDdx/587/JDfXsk3yBTLZ3UZOMtBVrkmwgk+1FJZ8ULJ3ud1xZcuh2icunIkc7tGVv2axdnw== +"@sentry/feedback@10.72.0": + version "10.72.0" + resolved "https://registry.yarnpkg.com/@sentry/feedback/-/feedback-10.72.0.tgz#4184a8012307813c2ac4883886074c0287edf4f3" + integrity sha512-UPCABAD5WkOIg8XfyH58B5hsP19RGBbMXmiu7k7yQ0kFr/QIsn1tO2ts5w8ek5tIuTdAaeK3L+tinnCRh2STbg== dependencies: - "@sentry/core" "10.70.0" + "@sentry/core" "10.72.0" "@sentry/react@^10.57.0": - version "10.70.0" - resolved "https://registry.yarnpkg.com/@sentry/react/-/react-10.70.0.tgz#fc1dd37ce48e306b658b7ab6d401426cfa37e231" - integrity sha512-j1d/4hvoaUVKs5GRrfmwUCkiEmkfaeHsk+xgausZlzg5YvmwpF+gyevBLNP26GFEH7nyHXW4l8dbbo0eNieJmw== + version "10.72.0" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-10.72.0.tgz#57048591a2c0459de5c82d6e563b0492cb9068f2" + integrity sha512-I+/Wq2duluHIGoCVbtm2FsC4kp160hNmKVFlCVa/UsutsuEbZAcFC1GI8Zzg/uUWbR7x/LhH7OqP9jdfwJsm4Q== dependencies: - "@sentry/browser" "10.70.0" + "@sentry/browser" "10.72.0" "@sentry/conventions" "^0.16.0" - "@sentry/core" "10.70.0" + "@sentry/core" "10.72.0" -"@sentry/replay-canvas@10.70.0": - version "10.70.0" - resolved "https://registry.yarnpkg.com/@sentry/replay-canvas/-/replay-canvas-10.70.0.tgz#16a3a57ea36bab248925b6d0ca709af7c95012c6" - integrity sha512-irzpw22bK5CF3jbecDa0gBUcfjv7tgeUoLAvtIfeHOP5ajmf3o4Cp99a9RQqkfgvkcMeRZBUwE91SQhp6Ank+w== +"@sentry/replay-canvas@10.72.0": + version "10.72.0" + resolved "https://registry.yarnpkg.com/@sentry/replay-canvas/-/replay-canvas-10.72.0.tgz#a8a53c8d257019f36fc289f3e798628b90ec19dc" + integrity sha512-RdNCbuQ1TBsyCrkHDBPTukQ3gtm8chXi0ldiJSiNUduPGCoKet9L1JocTqJ2gMguV+bOK+QLMvFnBCDbdcSg6A== dependencies: - "@sentry/core" "10.70.0" - "@sentry/replay" "10.70.0" + "@sentry/core" "10.72.0" + "@sentry/replay" "10.72.0" -"@sentry/replay@10.70.0": - version "10.70.0" - resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-10.70.0.tgz#2138a596a152f07e5076f300ffbeba0bab03817e" - integrity sha512-xMnSGzJn9Xd29rYd32lkx/gFW+5mtgqADJ2FiZvis0MBGZuDlNRwPn0/Cs1xA3JNXKV3NGfhdmmvs90w4dHSmw== +"@sentry/replay@10.72.0": + version "10.72.0" + resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-10.72.0.tgz#07753d8ce1f76f2aec2f8c91422ef884d3397222" + integrity sha512-DiUnhALGvEzaF7bSuRnr/Xftfh4eYZHQ9kwb+CRIDbJ0R2beetHH7vzE8vDe3pFMd8TWAuLkdNLMTC2ic9xfnA== dependencies: - "@sentry/browser-utils" "10.70.0" - "@sentry/core" "10.70.0" + "@sentry/browser-utils" "10.72.0" + "@sentry/core" "10.72.0" "@sinclair/typebox@^0.27.8": - version "0.27.10" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.10.tgz#beefe675f1853f73676aecc915b2bd2ac98c4fc6" - integrity sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA== + version "0.27.12" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.12.tgz#0cacd3cff047a32936b1ace47ea7c86eaab60a7f" + integrity sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g== "@standard-schema/spec@^1.0.0", "@standard-schema/spec@^1.1.0": version "1.1.0" @@ -1655,17 +1684,217 @@ resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-3.46.0.tgz#28ba3f4895715863fdd78b49a5617764c9557fe5" integrity sha512-f2RYFl3fzPwj5WO82x6en0dmkjefxEfOm16D1ByM6cj/McNiwOkL4VaPUoP9VVIrXAD9WnTSVFr70px703b//A== -"@tanstack/query-core@5.101.4": - version "5.101.4" - resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.101.4.tgz#c01b4289b3094144d8ef96235aa506242cf83efa" - integrity sha512-gNwcvOJcRbLWPOLG/2OBm+zM+Yv+MKsXKEOWC57USuZDEsI71hEErQsiEGx5wX9rzWWkfwM0fVSPoiIFSsxfiw== +"@tanstack/query-core@5.102.8": + version "5.102.8" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.102.8.tgz#c55c31b4f99124054805ce8ec8137c84108f3252" + integrity sha512-ZNjkJ33CqvPNec/6lZBnHqLc3EVGPZ9ySLhYahU9TcuRFdmwXewuj0c4hwSWcGHqEUwcSrKeZ+oGcvPBqXcQcg== "@tanstack/react-query@^5.101.0": - version "5.101.4" - resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.101.4.tgz#044137754d79aaa30a82f6e6c42488be79c86ea7" - integrity sha512-yRg2pfOCxIs4ZJW3XYYHU/WgtD04FHSnfHlpRT7h7pR77hwkdRG4wxbKe4aq6P0RvXUTBSQpQeadS1SUYUe+KA== + version "5.102.8" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.102.8.tgz#bdc5c24485258e6ae2e7ecac0a4cf58c59937839" + integrity sha512-TYBea4OuXWD7MhaSHq069TWbFe7rcwWN6kzT7JF0OKi1K6c1gTv2IzD6A6ExJsCMozdkqBWeuIUZmu4KQg0O5A== dependencies: - "@tanstack/query-core" "5.101.4" + "@tanstack/query-core" "5.102.8" + +"@tiptap/core@3.30.5", "@tiptap/core@^3.23.6": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/core/-/core-3.30.5.tgz#9929ae10a5e0892fb1a38a197ae8208cdd3801ea" + integrity sha512-3O7N0FyKIfuLV+xrdWyDM3V5eUY/q2CgLjhhMwOAbM1Pu7VPp9VP+TpEYOdH8aRyB+h1vj5hX5A747D8ZrPfHA== + +"@tiptap/extension-blockquote@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-blockquote/-/extension-blockquote-3.30.5.tgz#7f67c0b03be4fe09d55af264a2a3f3fe38861bd3" + integrity sha512-8pf1ZDrl6XlVPUee/2YlWZPFSF7yqsJEX6WLW41x06MT1dapG3Qudcns0znj6kYsX8JXTJ+Mhegy4z19bvTtRg== + +"@tiptap/extension-bold@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-bold/-/extension-bold-3.30.5.tgz#c4f33edf4fe4a2213d64185ed5e86f9b48ae2f46" + integrity sha512-MLZS+s/BJiJbv2C2M3G4FQGn43kPwYUUr2TiW3afSn+dRkEZlDxx5CwZYbe1PEt2+VX/SIifn945Oqr3s0axSA== + +"@tiptap/extension-bubble-menu@^3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-bubble-menu/-/extension-bubble-menu-3.30.5.tgz#5edcb97ec819036b4425eb074d971990a45bf388" + integrity sha512-redcmBInVwmipjF/WEVcNwCUJgJygUv8leidfRb/jBSAwx7GgnQWPr2HVQDk9zeTt3ykWld2NRdrk94Crjymow== + dependencies: + "@floating-ui/dom" "^1.0.0" + +"@tiptap/extension-bullet-list@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-bullet-list/-/extension-bullet-list-3.30.5.tgz#7147b5600b292ab5824c15230339c49b996811d0" + integrity sha512-66OGw4suO0Gr/4QAEiSvVi0eSvEqStvu1moHUSvUlwvEqnuB0ME2w9HuRogPElzWdrYLzbBA47mlCi9Veva0ew== + +"@tiptap/extension-code-block@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-code-block/-/extension-code-block-3.30.5.tgz#90f11909df4e1254a0f954dcf3726dc9c4f57937" + integrity sha512-SvkNoOio2xBy9AtSMyFKMp88MTUvyIXsGCnuz71INV2wHdH4VfRPoQLT6e077LpTCa9w6LHyTKtbZA4HYOp7wg== + +"@tiptap/extension-code@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-code/-/extension-code-3.30.5.tgz#e73b5c9c83572f2244b74f8798c15eb2687329fd" + integrity sha512-0dCt8eBo4sMtw+LjUu+0GF0JrTlREROdWoy8TM5kFPxJ5ZU2LKDiROXDPwXStaaoFFR/aStLH9xSpdz7cHUiUA== + +"@tiptap/extension-document@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-document/-/extension-document-3.30.5.tgz#37a0f349f355428532fc5e4399a1df05fe379bb7" + integrity sha512-4mKoD3bBr5W2AQ2Y/7amOqcVw0eqJbUwRtwvxypeo5Hi0PB9O5Ev8P05c3EUTo10bllqdKYXGeCU5AcgdQsHWQ== + +"@tiptap/extension-dropcursor@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-dropcursor/-/extension-dropcursor-3.30.5.tgz#6434801d1f88d84be9a17855e0ed71ae4edbbcb2" + integrity sha512-gJxn9PMUee8zazQBYqbOZiI7zTFXPVJ15AzTnLfUu4eDtPieMwtpgcjhCt4bZlp37drLm+Li76wWLirb7iLxsw== + +"@tiptap/extension-floating-menu@^3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-floating-menu/-/extension-floating-menu-3.30.5.tgz#47156d5ae1f99edcd8dc9ad91c1104019b0481c0" + integrity sha512-gTjGPWUpGn8IoW533TciZJZC/81LmBgU7zee+aRMRF3ix3K2z1pJjl6knDvrRQA6Kom+yWFaiueqGNXkrk38XQ== + +"@tiptap/extension-gapcursor@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-gapcursor/-/extension-gapcursor-3.30.5.tgz#59473f8ae8e05bb3eaf85cb3337a7115ac243ecf" + integrity sha512-h3m2ZA1XXLAfdHwdtG0MZnf0KWbNyP8xTI3RUlTDR5apmKmYVBaeocOJwTcFFZ92gPKqxYKyhteZqYtHOCZGJA== + +"@tiptap/extension-hard-break@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-hard-break/-/extension-hard-break-3.30.5.tgz#90e306d80301511bd70357d8bb38324d0abe4682" + integrity sha512-PcL4Z8l/DlauwZUJg0jf6SXKk6/YOXJtd8yYzqHrmCLRoY4kAa7+TxUhc/lWhuitUiOZ8+nB8V/NNM+WR6mRaw== + +"@tiptap/extension-heading@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-heading/-/extension-heading-3.30.5.tgz#553532bcca4cda2479ae0b0f528cbf5391c51d39" + integrity sha512-x7e7+p1bWXvwz6vqONPP1SVB73V0gZP7LIDL/5KMnxWLjahMTabgVPgjV30kz7GsOEgUYtEf7eCyGVGNNWL5Dg== + +"@tiptap/extension-horizontal-rule@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-3.30.5.tgz#fa860425996bf49f89113c5c841e488d69e24177" + integrity sha512-s5t2xM6wPYRJl2cqYplc7Ze8m8xddk4DP2v0aLFcUuD100D1B5eJbxsiwLK6wBAzNwiuVjd486RnmUpcswaXhQ== + +"@tiptap/extension-image@^3.23.6": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-image/-/extension-image-3.30.5.tgz#8689a95e7353e524430e81ad2aadee37abc4f7b2" + integrity sha512-fETBsbSTaf5MLCGZaffHRRAFYUHeDIeITbnm7Q5Il+/LlX7PEiBZGKVyD/M3bIMpxhkyB0UlryIYGhC5LjN1Aw== + +"@tiptap/extension-italic@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-italic/-/extension-italic-3.30.5.tgz#21d4efc55af18e67ffbead11e6bd9d515cbb447c" + integrity sha512-Fu9EuSRlHQNGES7UhY4mQod3yUKnWwxsGlPuDJURfwju/Ug04Jz8iRuERZBPcRgLNkwKDmbDsWUZF72RRIL2Uw== + +"@tiptap/extension-link@3.30.5", "@tiptap/extension-link@^3.23.6": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-link/-/extension-link-3.30.5.tgz#c30829c2a77734154abc5d78a88ffbc2a09570aa" + integrity sha512-zsQ+q83HpCYOMTNzdjb12dggE7sZMp0aqQJhArdavSTl8hLbVY/u3qJN88t25IEwAKVK0pcTJfWWA2QFl8bjAQ== + dependencies: + linkifyjs "^4.3.3" + +"@tiptap/extension-list-item@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-list-item/-/extension-list-item-3.30.5.tgz#abb9eb6c7045012ad52e1b6a5c8f4c74269ff8e4" + integrity sha512-N0fKUyQkPQBvVB48imjfIfdexU9VsAX1RydajYP2xAt+QOJ8KHVmXv1EGTp+v7pGdZMLdls1cSZ2f352vW3aWQ== + +"@tiptap/extension-list-keymap@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-list-keymap/-/extension-list-keymap-3.30.5.tgz#02fc9ef93acd86de1cc399b27fae9ccf8d7dbb4b" + integrity sha512-3pLR2yo29uhowaGMbD8v71XpgdNmqotBg1NXlyTMVFzxELj+VjjeLLTqSguR/iWDUbHXNzIsfMEgpRnNMO//8w== + +"@tiptap/extension-list@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-list/-/extension-list-3.30.5.tgz#4ba0c7fb629fce7dea91bfc538b2b2d04902339d" + integrity sha512-CHThihH+7TA0TfwtmA+eTXP1MAsA/+p011olJHg8Rilj5xA+L+0IFkjhN16JnZkBgSA4MnfEv15UMNfRaNpuVg== + +"@tiptap/extension-ordered-list@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-ordered-list/-/extension-ordered-list-3.30.5.tgz#e9cdc550ebd4838946ec726356e3728aa43fe0b9" + integrity sha512-bUGUnSAgjZhoUWBtr+1wRJHF3NnNvuKQr6sQ8le1tJ2yvLq448ZsSZjZGvTNeLsy3GDKBoMJ0rqLUK34+nM3hg== + +"@tiptap/extension-paragraph@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-paragraph/-/extension-paragraph-3.30.5.tgz#5134944deac793b24760add8563486503729076c" + integrity sha512-GrNNlAImfQhYRtGE95YNAjcTclUUMPHs9JeE9vMgfcoKcOmZ6GsbWUdN0hA55xqwGaUjnroOVtf77K9z1EbkJQ== + +"@tiptap/extension-strike@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-strike/-/extension-strike-3.30.5.tgz#68a87354187846181086c179df24e187c2caa617" + integrity sha512-r8IbWUm4YXNCkmc6h6dzuREQIGbO0x9z9l3GfQPUR3LxFtGssDLngE4dFXHRt/ejLWKEauy6clklf7LawtvYzw== + +"@tiptap/extension-table@^3.23.6": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-table/-/extension-table-3.30.5.tgz#ff61d121fd2f49c6fb84f1fa98d94c7a76aefee1" + integrity sha512-CToc47md2H3ioKhlcfX8eo/6+75Y/d5IK1P+szxOcjm8z8cDoalaYp0zlrZiE5tVhwZxHJ1Luq9OZVOBVW9j7g== + +"@tiptap/extension-text@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-text/-/extension-text-3.30.5.tgz#3e56fd456312287ac130466e7e5de3f36edf6861" + integrity sha512-pOgj4mIGFlw4NUdA6PCTFP/MHrYWnOYiZRYeu0I3/Yo3iN4Am/CgYBLl8PWsNh+YPO2hA2DWs7ZMke9D2j5R+g== + +"@tiptap/extension-underline@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extension-underline/-/extension-underline-3.30.5.tgz#8558a5691c2621f3cf076e153c9319cd39e60d99" + integrity sha512-u12G/WW2uFRY95BzrSAU9RW002K+7lFpSCL6fb7Puh8yLhek3lddOtAx0P+NI/PyMKtcoVMtBxoi+0mwVM7NPQ== + +"@tiptap/extensions@3.30.5": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/extensions/-/extensions-3.30.5.tgz#e70a44694a7727c8a580fd04096f9110edfd74f0" + integrity sha512-5x3OiCYBvXz0G5OGM8f7ka++1dh9EXdNRZ8IcMcEd+QwW4RPwvmJ2EjheA1eRRyMlcbNU7T+4IRlBXURlTetEA== + +"@tiptap/pm@3.30.5", "@tiptap/pm@^3.23.6": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/pm/-/pm-3.30.5.tgz#6d53957bd9d5b0bbde3ec49b449deaf16b8822f0" + integrity sha512-gufkLkW2tA6PZPjivYxDiGzTIIftwqhmYI6lvvKu2S4FbhcysJgMAe/GXVSywzCRVVex9SrvCe6RFYrqnwRitQ== + dependencies: + prosemirror-changeset "^2.4.1" + prosemirror-commands "^1.7.1" + prosemirror-dropcursor "^1.8.2" + prosemirror-gapcursor "^1.4.1" + prosemirror-history "^1.5.0" + prosemirror-inputrules "^1.5.1" + prosemirror-keymap "^1.2.3" + prosemirror-model "^1.25.11" + prosemirror-schema-list "^1.5.1" + prosemirror-state "^1.4.4" + prosemirror-tables "^1.8.5" + prosemirror-transform "^1.12.0" + prosemirror-view "^1.41.9" + +"@tiptap/react@^3.23.6": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/react/-/react-3.30.5.tgz#f8fe9219fec744b87b0285237ded9aadbe9ad218" + integrity sha512-QtHdOmYTCMRkCf5dmLtIqFq0e/yxavkQ6ZXbtytoftWEKJf3MjBTlX4nVAgpvrLAjPmCTxiehEXXxD1AJm/Syw== + dependencies: + "@types/use-sync-external-store" "^0.0.6" + fast-equals "^5.3.3" + use-sync-external-store "^1.4.0" + optionalDependencies: + "@tiptap/extension-bubble-menu" "^3.30.5" + "@tiptap/extension-floating-menu" "^3.30.5" + +"@tiptap/starter-kit@^3.23.6": + version "3.30.5" + resolved "https://registry.yarnpkg.com/@tiptap/starter-kit/-/starter-kit-3.30.5.tgz#40f291781c99611d9ded3deb1940b44a27852613" + integrity sha512-cmDRvukpoqjQjhE96q+l3tCLNZZcJKehxK+00Sp9F4XbKecfM2QpZ2TRHh3vi8qhCeDQNyMoCqfNaqznIjLjIQ== + dependencies: + "@tiptap/core" "3.30.5" + "@tiptap/extension-blockquote" "3.30.5" + "@tiptap/extension-bold" "3.30.5" + "@tiptap/extension-bullet-list" "3.30.5" + "@tiptap/extension-code" "3.30.5" + "@tiptap/extension-code-block" "3.30.5" + "@tiptap/extension-document" "3.30.5" + "@tiptap/extension-dropcursor" "3.30.5" + "@tiptap/extension-gapcursor" "3.30.5" + "@tiptap/extension-hard-break" "3.30.5" + "@tiptap/extension-heading" "3.30.5" + "@tiptap/extension-horizontal-rule" "3.30.5" + "@tiptap/extension-italic" "3.30.5" + "@tiptap/extension-link" "3.30.5" + "@tiptap/extension-list" "3.30.5" + "@tiptap/extension-list-item" "3.30.5" + "@tiptap/extension-list-keymap" "3.30.5" + "@tiptap/extension-ordered-list" "3.30.5" + "@tiptap/extension-paragraph" "3.30.5" + "@tiptap/extension-strike" "3.30.5" + "@tiptap/extension-text" "3.30.5" + "@tiptap/extension-underline" "3.30.5" + "@tiptap/extensions" "3.30.5" + "@tiptap/pm" "3.30.5" "@types/babel__core@^7.1.18", "@types/babel__core@^7.20.5": version "7.20.5" @@ -1700,13 +1929,6 @@ dependencies: "@babel/types" "^7.28.2" -"@types/codemirror@^5.60.10", "@types/codemirror@~5.60.5": - version "5.60.17" - resolved "https://registry.yarnpkg.com/@types/codemirror/-/codemirror-5.60.17.tgz#754649d285e0e775fe912ad2f5e757f22a70e1cf" - integrity sha512-AZq2FIsUHVMlp7VSe2hTfl5w4pcUkoFkM3zVsRKsn1ca8CXRDYvnin04+HP2REkwsxemuHqvDofdlhUWNpbwfw== - dependencies: - "@types/tern" "*" - "@types/d3-array@^3.0.3": version "3.2.2" resolved "https://registry.yarnpkg.com/@types/d3-array/-/d3-array-3.2.2.tgz#e02151464d02d4a1b44646d0fcdb93faf88fde8c" @@ -1742,9 +1964,9 @@ "@types/d3-time" "*" "@types/d3-shape@^3.1.0": - version "3.1.8" - resolved "https://registry.yarnpkg.com/@types/d3-shape/-/d3-shape-3.1.8.tgz#d1516cc508753be06852cd06758e3bb54a22b0e3" - integrity sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w== + version "3.2.0" + resolved "https://registry.yarnpkg.com/@types/d3-shape/-/d3-shape-3.2.0.tgz#66ff342011dc243c6c20e6b899523d148aca412d" + integrity sha512-kVd74ta9eof3eJOvbNd1vGKS/XERRyQbT26Og63hIsvDO84cjD5gEOhsXf26w3FSoNlPVz84DOFcKv/oou+fMw== dependencies: "@types/d3-path" "*" @@ -1758,7 +1980,7 @@ resolved "https://registry.yarnpkg.com/@types/d3-timer/-/d3-timer-3.0.2.tgz#70bbda77dc23aa727413e22e214afa3f0e852f70" integrity sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw== -"@types/estree@*", "@types/estree@1.0.9", "@types/estree@^1.0.0": +"@types/estree@1.0.9", "@types/estree@^1.0.0": version "1.0.9" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.9.tgz#cf3f0e876d7bee15a93ab925b82bf570a3904a24" integrity sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg== @@ -1797,15 +2019,10 @@ resolved "https://registry.yarnpkg.com/@types/jsesc/-/jsesc-2.5.1.tgz#c34defc608ec94b68dc6a12a581b440942c6d503" integrity sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw== -"@types/marked@^4.0.7": - version "4.3.2" - resolved "https://registry.yarnpkg.com/@types/marked/-/marked-4.3.2.tgz#e2e0ad02ebf5626bd215c5bae2aff6aff0ce9eac" - integrity sha512-a79Yc3TOk6dGdituy8hmTTJXjOkZ7zsFYV10L337ttq/rec8lRMDBpV7fL3uLx6TgbFCa5DU/h8FmIBQPSbU0w== - "@types/node@*", "@types/node@^26.0.1": - version "26.2.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-26.2.0.tgz#5a4875a862fda8fdc57de8faa579bb81ecba1685" - integrity sha512-5IviulTZeRNp2vAJ514cc/HUlY5nZ9fCbq9DMyC52BrhFZACo3nI0R7qBxhQmo/d27NFe96ur/b7Wwxklda+kg== + version "26.4.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-26.4.0.tgz#4c4ca071c42241fe602741d02999f16b4e64c468" + integrity sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ== dependencies: undici-types "~8.3.0" @@ -1822,9 +2039,9 @@ "@types/node" "*" "@types/react-dom@^19.2.3": - version "19.2.3" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-19.2.3.tgz#c1e305d15a52a3e508d54dca770d202cb63abf2c" - integrity sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ== + version "19.2.5" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-19.2.5.tgz#d4ecf8d704cab59901d3fbb0975b6f855306595f" + integrity sha512-fMPwH9v7r/pp43yUd2/Mbiex5KouJwwR3dzHkhLREUC6764VyDsqxhAxv6OFEYR1RhjOyD1naqba8ECDBe7ZQg== "@types/react-grid-layout@^1.3.5": version "1.3.6" @@ -1863,19 +2080,12 @@ "@types/react" "*" "@types/react@*", "@types/react@^19.2.17": - version "19.2.17" - resolved "https://registry.yarnpkg.com/@types/react/-/react-19.2.17.tgz#dccac365baa0f1734ec270ff4b51c89465e8dc7f" - integrity sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw== + version "19.2.18" + resolved "https://registry.yarnpkg.com/@types/react/-/react-19.2.18.tgz#eb0b6a1fb635d1a9692d5f84a3495bd8ad153707" + integrity sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w== dependencies: csstype "^3.2.2" -"@types/tern@*": - version "0.23.9" - resolved "https://registry.yarnpkg.com/@types/tern/-/tern-0.23.9.tgz#6f6093a4a9af3e6bb8dde528e024924d196b367c" - integrity sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw== - dependencies: - "@types/estree" "*" - "@types/trusted-types@^2.0.7": version "2.0.7" resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11" @@ -2048,9 +2258,9 @@ acorn-jsx@^5.3.2: integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn@^8.14.0, acorn@^8.15.0, acorn@^8.16.0, acorn@^8.4.0: - version "8.16.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.16.0.tgz#4ce79c89be40afe7afe8f3adb902a1f1ce9ac08a" - integrity sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw== + version "8.18.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.18.0.tgz#4faf01b2d6d326bfeed97aea1f52220b5f4c1940" + integrity sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ== agent-base@6: version "6.0.2" @@ -2125,9 +2335,9 @@ attr-accept@^2.2.4: integrity sha512-0bDNnY/u6pPwHDMoF0FieU354oBi0a8rD9FcsLwzcGWbc8KS8KPIi7y+s13OlVY+gMWc/9xEMUgNE6Qm8ZllYQ== axios@^1.17.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.19.0.tgz#ddf864d4c8233c0e6873746ab59361537d05ad39" - integrity sha512-ht/iuYZXEjFxLH/Hkezgd7m6JKlHHXEUSneaDz8uZe1Gj5QZtCnpyDsckvAiEnT89OEbCLmnte4R4sn7P0EKFw== + version "1.20.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.20.0.tgz#515513445aa60e71d04b6521ca6210829ccb4786" + integrity sha512-r8aOh8j9cGKpgQAqpzrUHnSIc6a59Y3Xf/cv8sy1DrHCkZHzQGEuoq1tARk6qSyDdtQGSDgpb9kFlruzPvrgwg== dependencies: follow-redirects "^1.16.0" form-data "^4.0.6" @@ -2153,10 +2363,10 @@ base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -baseline-browser-mapping@^2.10.12: - version "2.10.38" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.38.tgz#c84d093c4bf7325c5053c279d90f153c66526042" - integrity sha512-31/02mVB4yuQU6adKk5SlY6m+mxDwUq5KZkyYgnLrrKl7TEm1+3PyDtDBz2kOv/wxZz41GHsvV1A/u6RmiyBvw== +baseline-browser-mapping@^2.11.12: + version "2.11.20" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.20.tgz#26078c7a4b08299656ea7ddceaebec955dc44303" + integrity sha512-H0ulySigv6icDJ1F7SjtdCD6PrhTpdYCmP0CactWy1+ekh0AFd0o1Wn5T8b+hnTmdBx19u9yhL6wvCylXMY7zw== basic-auth@^2.0.1: version "2.0.1" @@ -2184,10 +2394,10 @@ bl@^4.1.0: inherits "^2.0.4" readable-stream "^3.4.0" -brace-expansion@^5.0.5: - version "5.0.7" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-5.0.7.tgz#1b0e46965b479dad65af737b4a02790a05498337" - integrity sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA== +brace-expansion@^5.0.8: + version "5.0.9" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-5.0.9.tgz#7c72438809b5fa5babf54199a1f1c281a6984fcf" + integrity sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg== dependencies: balanced-match "^4.0.2" @@ -2199,15 +2409,15 @@ braces@^3.0.3, braces@~3.0.2: fill-range "^7.1.1" browserslist@^4.24.0: - version "4.28.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.2.tgz#f50b65362ef48974ca9f50b3680566d786b811d2" - integrity sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg== + version "4.28.8" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.8.tgz#a3c79ceb70028527e5da7dafc887f3200b5168c0" + integrity sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA== dependencies: - baseline-browser-mapping "^2.10.12" - caniuse-lite "^1.0.30001782" - electron-to-chromium "^1.5.328" - node-releases "^2.0.36" - update-browserslist-db "^1.2.3" + baseline-browser-mapping "^2.11.12" + caniuse-lite "^1.0.30001809" + electron-to-chromium "^1.5.402" + node-releases "^2.0.53" + update-browserslist-db "^1.3.0" buffer@^5.5.0: version "5.7.1" @@ -2260,10 +2470,10 @@ camelize@^1.0.0: resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.1.tgz#89b7e16884056331a35d6b5ad064332c91daa6c3" integrity sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ== -caniuse-lite@^1.0.30001782: - version "1.0.30001799" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001799.tgz#5c909138c27f1a61219d3e092071c1cc7d32dc55" - integrity sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw== +caniuse-lite@^1.0.30001809: + version "1.0.30001810" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz#4970b477dea3278374de9bc43aa8f5d39fc3cda2" + integrity sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg== chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -2331,18 +2541,6 @@ clsx@^2.0.0, clsx@^2.1.1: resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.1.1.tgz#eed397c9fd8bd882bfb18deab7102049a2f32999" integrity sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA== -codemirror-spell-checker@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/codemirror-spell-checker/-/codemirror-spell-checker-1.1.2.tgz#1c660f9089483ccb5113b9ba9ca19c3f4993371e" - integrity sha512-2Tl6n0v+GJRsC9K3MLCdLaMOmvWL0uukajNJseorZJsslaxZyZMgENocPU8R0DyoTAiKsyqiemSOZo7kjGV0LQ== - dependencies: - typo-js "*" - -codemirror@^5.65.15: - version "5.65.21" - resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.65.21.tgz#cacf320606c5450ad3b3da34bb9c666afec21068" - integrity sha512-6teYk0bA0nR3QP0ihGMoxuKzpl5W80FpnHpBJpgy66NK3cZv5b/d/HY8PnRvfSsCG1MTfr92u2WUl+wT0E40mQ== - codemirror@^6.0.0, codemirror@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-6.0.2.tgz#4d3fea1ad60b6753f97ca835f2f48c6936a8946e" @@ -2410,10 +2608,10 @@ confbox@^0.2.4: resolved "https://registry.yarnpkg.com/confbox/-/confbox-0.2.4.tgz#592e7be71f882a4a874e3c88f0ac1ef6f7da1ce5" integrity sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ== -content-type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-2.0.0.tgz#2fb3ede69dffa0af78ca7c4ce7589680638b56df" - integrity sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ== +content-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-3.0.0.tgz#c946981e09aba276f5f5b21223bd0c01fded9c15" + integrity sha512-AIi5H6p0xk5uknXcN3/rmhP8jgp69OfSe/JuKiQAFprJ7UGw7mwj7m4XcmDzlrnJDG+cGpphAINGdU3g3g7kDw== convert-source-map@^1.5.0, convert-source-map@^1.7.0: version "1.9.0" @@ -2447,9 +2645,9 @@ cosmiconfig@^8.0.0: path-type "^4.0.0" crelt@^1.0.5, crelt@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/crelt/-/crelt-1.0.6.tgz#7cc898ea74e190fb6ef9dae57f8f81cf7302df72" - integrity sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g== + version "1.0.7" + resolved "https://registry.yarnpkg.com/crelt/-/crelt-1.0.7.tgz#3b441b2ddfa73161d6a2770aa4cd677f895eaf28" + integrity sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA== cross-spawn@^7.0.0, cross-spawn@^7.0.3, cross-spawn@^7.0.6: version "7.0.6" @@ -2635,9 +2833,9 @@ dom-helpers@^5.0.1: csstype "^3.0.2" dompurify@^3.4.8: - version "3.4.13" - resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.4.13.tgz#fc28949d59f92d62e28a3a764bcbeee35897a1be" - integrity sha512-2vmYIoqjze2d+kakP8S/nS5shfsl587kzwEjcGlTdiksUVgFHnFCsLYDVj/JNqJVOQZGSYBTmuycv0PodwmnMQ== + version "3.4.14" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.4.14.tgz#a789edb2c7bcdb69a93713a34edb7e0a5245d8c9" + integrity sha512-dVoH9z+MY+C9IilgGCk3YfFqjLi3fChm2OiKJMzh6axrJ5qwxqWaZamgmHrpv22CN/KdbZJuGEGgfQoL00LTdg== optionalDependencies: "@types/trusted-types" "^2.0.7" @@ -2650,21 +2848,10 @@ dunder-proto@^1.0.1: es-errors "^1.3.0" gopd "^1.2.0" -easymde@^2.21.0: - version "2.21.0" - resolved "https://registry.yarnpkg.com/easymde/-/easymde-2.21.0.tgz#12e77962e27d401f9572296189bee21e0be086a8" - integrity sha512-5uE7I/DEN8gvGRwxaqAv7h1PMEK2ykNXVX5zL0dK3nCYROGja3AMbdQz8eCEELnfvCfy7tRkTmLuvyJG8uSWjQ== - dependencies: - "@types/codemirror" "^5.60.10" - "@types/marked" "^4.0.7" - codemirror "^5.65.15" - codemirror-spell-checker "1.1.2" - marked "^4.1.0" - -electron-to-chromium@^1.5.328: - version "1.5.375" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.375.tgz#54a9a616dc2b3765e7263d98d14c2135408954d9" - integrity sha512-ZWP5eB4BVPW/ZYo9252hQZHZ5XavtsTgpbhcmMmRwymavC5AsLWQWBPaKMeNd2LW0KGby5HPXvj7+sr4ta5j/Q== +electron-to-chromium@^1.5.402: + version "1.5.416" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.416.tgz#d3efc642529905e0fd7500749d18a3e88347be1a" + integrity sha512-K6bvB2BjnNrugtIih6ewlbBI9DXa976jIdiIlRLHhBoEI9a4JaQjjHyF+A1IQI543aQYR4LnmOrT/K5fZj0aPA== embla-carousel-react@^8.6.0: version "8.6.0" @@ -2717,9 +2904,9 @@ es-module-lexer@^0.4.1: integrity sha512-ooYciCUtfw6/d2w56UVeqHPcoCFAiJdz5XOkYpv/Txl1HMUozpXjz/2RIQgqwKdXNDPSF1W7mJCFse3G+HDyAA== es-module-lexer@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-2.1.0.tgz#1dfcbb5ea3bbfb63f28e1fc3676c3676d1c9624c" - integrity sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ== + version "2.3.2" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-2.3.2.tgz#311fa4f40168c1975c505477c51b23234d41ad55" + integrity sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw== es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: version "1.1.2" @@ -2739,9 +2926,9 @@ es-set-tostringtag@^2.1.0: hasown "^2.0.2" es-toolkit@^1.39.3: - version "1.47.0" - resolved "https://registry.yarnpkg.com/es-toolkit/-/es-toolkit-1.47.0.tgz#846778dac47af951f9917363ec5a3b94beeb8ddc" - integrity sha512-n1GuoD0WEQZMBk5tttoZSqwgyLx01oqa5XsBmCHwPyNe1S9jPBEmtR2pSgp2kJuWE3ciFZ6yRHmY4pM4C3OOkw== + version "1.52.0" + resolved "https://registry.yarnpkg.com/es-toolkit/-/es-toolkit-1.52.0.tgz#71eaf1a8b18834ef77637eccbb885ba4c03cd6dd" + integrity sha512-XTNEJQh1tY1ZJVcf6ayP/2n4ZPyaHlW2FWs7xvw5ddPuhUVjLD3olQVQS7kf58JbAB48iL0uL/jerTrjtV3lDA== es6-error@^4.0.1: version "4.1.1" @@ -2749,36 +2936,36 @@ es6-error@^4.0.1: integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== esbuild@^0.25.1, "esbuild@^0.27.0 || ^0.28.0", esbuild@^0.28, "esbuild@npm:esbuild@>=0.17.6 <0.29.0": - version "0.28.1" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.28.1.tgz#ef45b4634c9c9d97a296aea4114a5f9840f95578" - integrity sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw== + version "0.28.2" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.28.2.tgz#0f43bd1bad955b72d24e2261e3abe5957ccf0816" + integrity sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA== optionalDependencies: - "@esbuild/aix-ppc64" "0.28.1" - "@esbuild/android-arm" "0.28.1" - "@esbuild/android-arm64" "0.28.1" - "@esbuild/android-x64" "0.28.1" - "@esbuild/darwin-arm64" "0.28.1" - "@esbuild/darwin-x64" "0.28.1" - "@esbuild/freebsd-arm64" "0.28.1" - "@esbuild/freebsd-x64" "0.28.1" - "@esbuild/linux-arm" "0.28.1" - "@esbuild/linux-arm64" "0.28.1" - "@esbuild/linux-ia32" "0.28.1" - "@esbuild/linux-loong64" "0.28.1" - "@esbuild/linux-mips64el" "0.28.1" - "@esbuild/linux-ppc64" "0.28.1" - "@esbuild/linux-riscv64" "0.28.1" - "@esbuild/linux-s390x" "0.28.1" - "@esbuild/linux-x64" "0.28.1" - "@esbuild/netbsd-arm64" "0.28.1" - "@esbuild/netbsd-x64" "0.28.1" - "@esbuild/openbsd-arm64" "0.28.1" - "@esbuild/openbsd-x64" "0.28.1" - "@esbuild/openharmony-arm64" "0.28.1" - "@esbuild/sunos-x64" "0.28.1" - "@esbuild/win32-arm64" "0.28.1" - "@esbuild/win32-ia32" "0.28.1" - "@esbuild/win32-x64" "0.28.1" + "@esbuild/aix-ppc64" "0.28.2" + "@esbuild/android-arm" "0.28.2" + "@esbuild/android-arm64" "0.28.2" + "@esbuild/android-x64" "0.28.2" + "@esbuild/darwin-arm64" "0.28.2" + "@esbuild/darwin-x64" "0.28.2" + "@esbuild/freebsd-arm64" "0.28.2" + "@esbuild/freebsd-x64" "0.28.2" + "@esbuild/linux-arm" "0.28.2" + "@esbuild/linux-arm64" "0.28.2" + "@esbuild/linux-ia32" "0.28.2" + "@esbuild/linux-loong64" "0.28.2" + "@esbuild/linux-mips64el" "0.28.2" + "@esbuild/linux-ppc64" "0.28.2" + "@esbuild/linux-riscv64" "0.28.2" + "@esbuild/linux-s390x" "0.28.2" + "@esbuild/linux-x64" "0.28.2" + "@esbuild/netbsd-arm64" "0.28.2" + "@esbuild/netbsd-x64" "0.28.2" + "@esbuild/openbsd-arm64" "0.28.2" + "@esbuild/openbsd-x64" "0.28.2" + "@esbuild/openharmony-arm64" "0.28.2" + "@esbuild/sunos-x64" "0.28.2" + "@esbuild/win32-arm64" "0.28.2" + "@esbuild/win32-ia32" "0.28.2" + "@esbuild/win32-x64" "0.28.2" escalade@^3.2.0: version "3.2.0" @@ -2828,9 +3015,9 @@ eventemitter3@^5.0.1: integrity sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw== exsolve@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/exsolve/-/exsolve-1.0.8.tgz#7f5e34da61cd1116deda5136e62292c096f50613" - integrity sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA== + version "1.1.1" + resolved "https://registry.yarnpkg.com/exsolve/-/exsolve-1.1.1.tgz#c055418255459b6ecde4e59de0060a3e97bc7572" + integrity sha512-9U/jZUgjnSGyntRr6y5Muu1MJcwFl6kPu7k8qLF0IMNfLqvw0NZ4nnVDq0RVoZ0RvCyumib4Ez3KYrVfilrw+g== fast-deep-equal@^3.1.3: version "3.1.3" @@ -2842,6 +3029,11 @@ fast-equals@^4.0.3: resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-4.0.3.tgz#72884cc805ec3c6679b99875f6b7654f39f0e8c7" integrity sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg== +fast-equals@^5.3.3: + version "5.4.1" + resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-5.4.1.tgz#a9174b03eece5307dbd675be6d6d42f7fa1d00ed" + integrity sha512-DjlFSM5Pk9cGcL0q5QXl66eGzx0N6szNgaswwc5ZphlBohjTVJSnGgI+rJVOgOi65qUoQnDZN4nDqi33udtydQ== + fdir@^6.4.3, fdir@^6.5.0: version "6.5.0" resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" @@ -2904,7 +3096,7 @@ foreground-child@^2.0.0: cross-spawn "^7.0.0" signal-exit "^3.0.2" -foreground-child@^3.3.0, foreground-child@^3.3.1: +foreground-child@^3.3.0: version "3.3.1" resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.3.1.tgz#32e8e9ed1b68a3497befb9ac2b6adf92a638576f" integrity sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw== @@ -3008,19 +3200,7 @@ glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" -glob@^11.0.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-11.1.0.tgz#4f826576e4eb99c7dad383793d2f9f08f67e50a6" - integrity sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw== - dependencies: - foreground-child "^3.3.1" - jackspeak "^4.1.1" - minimatch "^10.1.1" - minipass "^7.1.2" - package-json-from-dist "^1.0.0" - path-scurry "^2.0.0" - -glob@^13.0.3, glob@^13.0.6: +glob@^11.0.0, glob@^13.0.0, glob@^13.0.3, glob@^13.0.6: version "13.0.6" resolved "https://registry.yarnpkg.com/glob/-/glob-13.0.6.tgz#078666566a425147ccacfbd2e332deb66a2be71d" integrity sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw== @@ -3102,9 +3282,9 @@ ieee754@^1.1.13: integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== immer@^11.0.0, immer@^11.1.8: - version "11.1.15" - resolved "https://registry.yarnpkg.com/immer/-/immer-11.1.15.tgz#1b178a9338486ade5939fa76cff43f4a49001eb0" - integrity sha512-VrNANlmnWQnh5COXIIOQXM9oOJw7naGKlBT74ZOOR6lpVXc3gFEu9FJLDFcpCJ2j+NWr8TIwtWD//T6ZX6TKiQ== + version "11.1.18" + resolved "https://registry.yarnpkg.com/immer/-/immer-11.1.18.tgz#87d9bced1e25157dc23bced66811de89460ec8f3" + integrity sha512-EQyQtLiYW029lyoczMl/Hh4Xu7cDecSc58JRYpHyL4tIAu3eqd1yJzQX04d2BZHDkzFFvm6qJEJWOtfDSWAXbQ== import-fresh@^3.2.1, import-fresh@^3.3.0: version "3.3.1" @@ -3285,13 +3465,6 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jackspeak@^4.1.1: - version "4.2.3" - resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-4.2.3.tgz#27ef80f33b93412037c3bea4f8eddf80e1931483" - integrity sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg== - dependencies: - "@isaacs/cliui" "^9.0.0" - javascript-stringify@^2.0.1: version "2.1.0" resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-2.1.0.tgz#27c76539be14d8bd128219a2d731b09337904e79" @@ -3340,9 +3513,9 @@ js-tokens@^10.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1, js-yaml@^4, js-yaml@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.2.0.tgz#2bd9e85682dd91bd469afb809d816043b3d49524" - integrity sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw== + version "4.3.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.3.2.tgz#8e44fb14a2643c59726bb15787b5f1512cb3d3fb" + integrity sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA== dependencies: argparse "^2.0.1" @@ -3356,10 +3529,10 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== -json-with-bigint@^3.5.3: - version "3.5.8" - resolved "https://registry.yarnpkg.com/json-with-bigint/-/json-with-bigint-3.5.8.tgz#1b1edb55a1bc4816ca87ac684297591acd822383" - integrity sha512-eq/4KP6K34kwa7TcFdtvnftvHCD9KvHOGGICWwMFc4dOOKF5t4iYqnfLK8otCRCRv06FXOzGGyqE8h8ElMvvdw== +json-with-bigint@^3.5.12: + version "3.5.12" + resolved "https://registry.yarnpkg.com/json-with-bigint/-/json-with-bigint-3.5.12.tgz#9f6bf722a9847ed72fa9b217b2b66181227c454c" + integrity sha512-uwbF/wSSuOgC7qqlq27Xp5B6a2MHVug3t0idZdTqu0JnlFvgJuH7ju+KAk/J06C7GfhoYy2gnb9wz2INqcne7w== json5@^2.2.3: version "2.2.3" @@ -3395,6 +3568,11 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== +linkifyjs@^4.3.3: + version "4.3.3" + resolved "https://registry.yarnpkg.com/linkifyjs/-/linkifyjs-4.3.3.tgz#da08f0eeb4d89a24541d09591fbdcc211eb8fef0" + integrity sha512-P8aEP5U/D1/IlTY2OeYsErdwh9bGuLE30NcXtKEjgdHcahveQoQwM2yZNsioQHsWFz0P7KKudisbrzCgR0sDHg== + local-pkg@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-1.2.1.tgz#9628389399851d78f3b50c9236eddb02f0c31b2b" @@ -3449,9 +3627,9 @@ lru-cache@^10.4.3: integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== lru-cache@^11.0.0: - version "11.5.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.5.1.tgz#f3daa3540847b9737ebc02499ddb36765e54db4a" - integrity sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A== + version "11.5.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.5.2.tgz#00e16665c90c620fba14a3c368732a976493f760" + integrity sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g== lru-cache@^5.1.1: version "5.1.1" @@ -3498,11 +3676,6 @@ mantine-datatable@^9.2.2: resolved "https://registry.yarnpkg.com/mantine-datatable/-/mantine-datatable-9.4.0.tgz#b71a2ee0dc9c998926d80f254d9d5926fdfdb741" integrity sha512-yFym2vlboGaqSD1bqXVtADMWg8YJtdyc3USQUTSqcLgEWzRPQqK/9WBBU0+XVE2qvMHZfiunuJK+UZV4aa2KmA== -marked@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" - integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== - math-intrinsics@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" @@ -3550,12 +3723,12 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^10.1.1, minimatch@^10.2.2: - version "10.2.5" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.2.5.tgz#bd48687a0be38ed2961399105600f832095861d1" - integrity sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg== +minimatch@^10.2.2: + version "10.2.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.2.6.tgz#fd956bbe0b77241e9f15ac5dccb1c638060968ef" + integrity sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A== dependencies: - brace-expansion "^5.0.5" + brace-expansion "^5.0.8" minipass@^7.1.2, minipass@^7.1.3: version "7.1.3" @@ -3592,10 +3765,10 @@ ms@^2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanoid@^3.3.16: - version "3.3.16" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.16.tgz#a04d8ec4b1f10009d2d533947aefe4293737816c" - integrity sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q== +nanoid@^3.3.17: + version "3.3.18" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.18.tgz#f66a2de1199ffde0fcf21c8a5f13106b1c081913" + integrity sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w== node-preload@^0.2.1: version "0.2.1" @@ -3604,10 +3777,10 @@ node-preload@^0.2.1: dependencies: process-on-spawn "^1.0.0" -node-releases@^2.0.36: - version "2.0.47" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.47.tgz#521bb2786da8eb140b748841c0b3b3a75334ffc4" - integrity sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og== +node-releases@^2.0.53: + version "2.0.54" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.54.tgz#09af17d5647aa9f221ec5cf2becb95b68a981afe" + integrity sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" @@ -3667,9 +3840,9 @@ observable-fns@^0.6.1: integrity sha512-9gRK4+sRWzeN6AOewNBTLXir7Zl/i3GB6Yl26gK4flxz8BXVpD3kt8amREmWNb0mxYOGDotvE5a4N+PtGGKdkg== obug@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/obug/-/obug-2.1.2.tgz#024d704dceae438ef875556ebf9e22e47fd951c2" - integrity sha512-AWGB9WFcRXOQs48Z/udjI5ZcZMHXwX8XPByNpOydgcGsDLIzjGizhoMWJyKAWze7AVW/2W1i+/gPX4YtKe5cyg== + version "2.1.4" + resolved "https://registry.yarnpkg.com/obug/-/obug-2.1.4.tgz#9090d8a548a522517915d2aa6aae907197ac6cf8" + integrity sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA== onetime@^5.1.0: version "5.1.2" @@ -3693,6 +3866,11 @@ ora@^5.1.0: strip-ansi "^6.0.0" wcwidth "^1.0.1" +orderedmap@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/orderedmap/-/orderedmap-2.1.1.tgz#61481269c44031c449915497bf5a4ad273c512d2" + integrity sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g== + otpauth@^9.5.1: version "9.5.1" resolved "https://registry.yarnpkg.com/otpauth/-/otpauth-9.5.1.tgz#e633203a848c2963c1df7039d47b97c02fb07e34" @@ -3750,7 +3928,7 @@ package-hash@^4.0.0: lodash.flattendeep "^4.4.0" release-zalgo "^1.0.0" -package-json-from-dist@^1.0.0, package-json-from-dist@^1.0.1: +package-json-from-dist@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505" integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw== @@ -3797,7 +3975,7 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-scurry@^2.0.0, path-scurry@^2.0.2: +path-scurry@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-2.0.2.tgz#6be0d0ee02a10d9e0de7a98bae65e182c9061f85" integrity sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg== @@ -3834,9 +4012,9 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: integrity sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA== picomatch@^4.0.2, picomatch@^4.0.3, picomatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.4.tgz#fd6f5e00a143086e074dffe4c924b8fb293b0589" - integrity sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A== + version "4.0.7" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.7.tgz#6313360034ccb36b3dc61ecbdff78121f90fe21f" + integrity sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA== pkg-dir@^4.1.0: version "4.2.0" @@ -3893,11 +4071,11 @@ postcss-value-parser@^4.0.2: integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== postcss@^8.5.6: - version "8.5.23" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.23.tgz#3493550116f478487298301d2c2e8dc5a56e6594" - integrity sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg== + version "8.5.26" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.26.tgz#6e75135780c7e10df3433bf2266c552d35c8c620" + integrity sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ== dependencies: - nanoid "^3.3.16" + nanoid "^3.3.17" picocolors "^1.1.1" source-map-js "^1.2.1" @@ -3936,15 +4114,128 @@ prop-types@15.x, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +prosemirror-changeset@^2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/prosemirror-changeset/-/prosemirror-changeset-2.4.2.tgz#26c53c5a14de9b970d05d81ac17c4c2f37094ec3" + integrity sha512-ViYrjMSg3YFiXwIhKaluu+/mi3Yrxt6AR8ri14ulTaGcZtXO1CThl7A2gv79qx5fQnOw8woKwyBU2u+9PVCm3w== + dependencies: + prosemirror-transform "^1.0.0" + +prosemirror-commands@^1.7.1: + version "1.7.2" + resolved "https://registry.yarnpkg.com/prosemirror-commands/-/prosemirror-commands-1.7.2.tgz#cbef3b0d722dc51e71cc936c87c4ca27d81df3a6" + integrity sha512-q6Q6szxqdu9Xd6EcdKsqXghu5nQdZTpB4Q9yd04WRc7/jt763e/rT60Owh0L1GYY+T46o5rD+9lEN36dZS43tw== + dependencies: + prosemirror-model "^1.0.0" + prosemirror-state "^1.0.0" + prosemirror-transform "^1.10.2" + +prosemirror-dropcursor@^1.8.2: + version "1.8.3" + resolved "https://registry.yarnpkg.com/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.3.tgz#726ae97baa251097306b0f7194a217a5ad9e8f9f" + integrity sha512-FoYbsJR8gK+DGlqhNoE29Loa38eIZPzQRIb1VMaDNBoo4OLP6vVof/jR8qFY/6XvUd6Dhug8MDCHl2a/h8RTfQ== + dependencies: + prosemirror-state "^1.0.0" + prosemirror-transform "^1.1.0" + prosemirror-view "^1.1.0" + +prosemirror-gapcursor@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/prosemirror-gapcursor/-/prosemirror-gapcursor-1.4.1.tgz#da33c905fece147df577342c06f4929b25d365ee" + integrity sha512-pMdYaEnjNMSwl11yjEGtgTmLkR08m/Vl+Jj443167p9eB3HVQKhYCc4gmHVDsLPODfZfjr/MmirsdyZziXbQKw== + dependencies: + prosemirror-keymap "^1.0.0" + prosemirror-model "^1.0.0" + prosemirror-state "^1.0.0" + prosemirror-view "^1.0.0" + +prosemirror-history@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/prosemirror-history/-/prosemirror-history-1.5.0.tgz#ee21fc5de85a1473e3e3752015ffd6d649a06859" + integrity sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg== + dependencies: + prosemirror-state "^1.2.2" + prosemirror-transform "^1.0.0" + prosemirror-view "^1.31.0" + rope-sequence "^1.3.0" + +prosemirror-inputrules@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/prosemirror-inputrules/-/prosemirror-inputrules-1.5.1.tgz#d2e935f6086e3801486b09222638f61dae89a570" + integrity sha512-7wj4uMjKaXWAQ1CDgxNzNtR9AlsuwzHfdFH1ygEHA2KHF2DOEaXl1CJfNPAKCg9qNEh4rum975QLaCiQPyY6Fw== + dependencies: + prosemirror-state "^1.0.0" + prosemirror-transform "^1.0.0" + +prosemirror-keymap@^1.0.0, prosemirror-keymap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/prosemirror-keymap/-/prosemirror-keymap-1.2.3.tgz#c0f6ab95f75c0b82c97e44eb6aaf29cbfc150472" + integrity sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw== + dependencies: + prosemirror-state "^1.0.0" + w3c-keyname "^2.2.0" + +prosemirror-model@^1.0.0, prosemirror-model@^1.21.0, prosemirror-model@^1.25.11, prosemirror-model@^1.25.4, prosemirror-model@^1.25.8: + version "1.25.11" + resolved "https://registry.yarnpkg.com/prosemirror-model/-/prosemirror-model-1.25.11.tgz#2ac01dce5176094a52cc1b889c20f3849563aba9" + integrity sha512-QWg9RhnpLlogAmp3p96uEFrE5txQpFynd4vhBAELkwgOCWQs/X0yCzB3/hrHqiPwf91RG5KyWq6553zs9JqIOQ== + dependencies: + orderedmap "^2.0.0" + +prosemirror-schema-list@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/prosemirror-schema-list/-/prosemirror-schema-list-1.5.1.tgz#5869c8f749e8745c394548bb11820b0feb1e32f5" + integrity sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q== + dependencies: + prosemirror-model "^1.0.0" + prosemirror-state "^1.0.0" + prosemirror-transform "^1.7.3" + +prosemirror-state@^1.0.0, prosemirror-state@^1.2.2, prosemirror-state@^1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/prosemirror-state/-/prosemirror-state-1.4.4.tgz#72b5e926f9e92dcee12b62a05fcc8a2de3bf5b39" + integrity sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw== + dependencies: + prosemirror-model "^1.0.0" + prosemirror-transform "^1.0.0" + prosemirror-view "^1.27.0" + +prosemirror-tables@^1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/prosemirror-tables/-/prosemirror-tables-1.8.5.tgz#104427012e5a5da1d2a38c122efee8d66bdd5104" + integrity sha512-V/0cDCsHKHe/tfWkeCmthNUcEp1IVO3p6vwN8XtwE9PZQLAZJigbw3QoraAdfJPir4NKJtNvOB8oYGKRl+t0Dw== + dependencies: + prosemirror-keymap "^1.2.3" + prosemirror-model "^1.25.4" + prosemirror-state "^1.4.4" + prosemirror-transform "^1.10.5" + prosemirror-view "^1.41.4" + +prosemirror-transform@^1.0.0, prosemirror-transform@^1.1.0, prosemirror-transform@^1.10.2, prosemirror-transform@^1.10.5, prosemirror-transform@^1.12.0, prosemirror-transform@^1.7.3: + version "1.12.0" + resolved "https://registry.yarnpkg.com/prosemirror-transform/-/prosemirror-transform-1.12.0.tgz#0239288d0e98d91e6af3dd269a8968466be406d7" + integrity sha512-GxboyN4AMIsoHNtz5uf2r2Ru551i5hWeCMD6E2Ib4Eogqoub0NflniaBPVQ4MrGE5yZ8JV9tUHg9qcZTTrcN4w== + dependencies: + prosemirror-model "^1.21.0" + +prosemirror-view@^1.0.0, prosemirror-view@^1.1.0, prosemirror-view@^1.27.0, prosemirror-view@^1.31.0, prosemirror-view@^1.41.4, prosemirror-view@^1.41.9: + version "1.42.3" + resolved "https://registry.yarnpkg.com/prosemirror-view/-/prosemirror-view-1.42.3.tgz#5b1c8f1b084f9ef2bd7f67057d1784383ee6ac55" + integrity sha512-oTN7EtH+CpwxU9NrwEYWd0UZ4JUx7l048l5A2Xppm4p/60isZYLnth9QVQmC3VRIvdrIWCxwZSd+Uz791G31/w== + dependencies: + prosemirror-model "^1.25.8" + prosemirror-state "^1.0.0" + prosemirror-transform "^1.1.0" + proxy-from-env@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-2.1.0.tgz#a7487568adad577cfaaa7e88c49cab3ab3081aba" integrity sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA== pseudolocale@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/pseudolocale/-/pseudolocale-2.2.0.tgz#0be76bafdbcdd448d21d247b0dc2d60b2f03c8f4" - integrity sha512-O+D2eU7fO9wVLqrohvt9V/9fwMadnJQ4jxwiK+LeNEqhMx8JYx4xQHkArDCJFAdPPOp/pQq6z5L37eBvAoc8jw== + version "2.3.0" + resolved "https://registry.yarnpkg.com/pseudolocale/-/pseudolocale-2.3.0.tgz#50e52463a2656f026d547322228c997e293c48d6" + integrity sha512-2RfZuwSSZ8sopelTIIZ2JhmO4GLnHflJQBmtMPF2APWEtmfKOsvqCIWsi8KQJ6EQ0D0+zVllPnLLGijUauSlqw== dependencies: commander "^10.0.0" @@ -3963,16 +4254,16 @@ quansync@^0.2.11: integrity sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA== react-dom@^19.2.7: - version "19.2.7" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.2.7.tgz#0450dc9ae9ddbff76ef196401cd8b8c7fb466ccc" - integrity sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ== + version "19.2.8" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.2.8.tgz#3b46b9eeda877cdff2cf13d2770fff4ae36c2ec2" + integrity sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ== dependencies: scheduler "^0.27.0" react-draggable@^4.4.5, react-draggable@^4.5.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.6.0.tgz#bae07fc729afe1a80c6cedd4775cc0d6856a0e0b" - integrity sha512-g4vqY53xhmPrBnZvGP+1YQV0eYnB3o0VLzoi6q2IpwnQrxIZ34tYRKpVtsWIXPg4D/pvLn+oYCW5gOK2cWIrgA== + version "4.7.1" + resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.7.1.tgz#e502c3cfe0cc97d691e12aaa377a975fce097d71" + integrity sha512-wa3tzfFnYt3yaZLuyU58fl1TNunfWfBekDgWhZA1+gb2jnp42wZ0ymuopR6M5kqDYmm4hKmzGlcKWjZf3Zb6RQ== dependencies: clsx "^2.1.1" prop-types "^15.8.1" @@ -3999,9 +4290,9 @@ react-grid-layout@1.4.4: resize-observer-polyfill "^1.5.1" react-hook-form@^7.78.0: - version "7.85.0" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.85.0.tgz#45b95cc794f9ed752ffc9121cc6ddcc92e97acf0" - integrity sha512-U2MTriFXnclmV4rOE20p2DcRFv5WEg3FIcBFOKcOLFHDVvGIMPvLTkTWefUsonmlaVy23khVDxDWym6uJVGOzw== + version "7.86.0" + resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.86.0.tgz#848a238acf20634a4193d9cee1d7e0a16cc1e126" + integrity sha512-4kbWJrh5jPZt1+YqVcXcGKffGcXV/XVbozknLh0Yjh0KhpoAkus21TAQhzRYqNwFkkObmnSvRlZZ3GT+ehoIrA== react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" @@ -4064,19 +4355,19 @@ react-resizable@^3.0.5: react-draggable "^4.5.0" react-router-dom@^6.30.4: - version "6.30.4" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.30.4.tgz#f7167bf3da6c7d9132130ea985dd06def25e84d5" - integrity sha512-q4HvNl+mmDdkS0g+MqiBZNteQJCuimWoOyHMy4T/RQLAn9Z29+E91QXRaxOujeMl2HTzRSS0KFPd7lxX3PjV0Q== + version "6.30.6" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.30.6.tgz#acaf0db65efeddabd0840616243c97f578b3baf3" + integrity sha512-0RHKZz7wwffvkU+2MFVT2NnjK44ssLEV+m0CAJaS2Ksmorrwj7WxH00jO0SOCW26/tINUnJHToXblDs33I38YQ== dependencies: - "@remix-run/router" "1.23.3" - react-router "6.30.4" + "@remix-run/router" "1.23.4" + react-router "6.30.6" -react-router@6.30.4: - version "6.30.4" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.30.4.tgz#638f35176527bd243d96d81d35d33b757bad46c2" - integrity sha512-SVUsDe+DybHM/WmYKIVYhZh1o5Dcuf16yM6WjG02Q9XVFMZIJyHYhwrr6bFBXZkVP6z69kNkMyBCujt8FaFLJA== +react-router@6.30.6: + version "6.30.6" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.30.6.tgz#a2ad70f3472de61c61e44182b3e5a25fd91f9f68" + integrity sha512-5HfK7k5im7LTOB0EqCQmfvy4C13G92Ssj1VTmouTK3AJvyjKTnFuCV0vcMAD/JS+JC4DvDIBRrlAeJIFjh5VWg== dependencies: - "@remix-run/router" "1.23.3" + "@remix-run/router" "1.23.4" react-select@^5.10.2: version "5.10.2" @@ -4093,13 +4384,6 @@ react-select@^5.10.2: react-transition-group "^4.3.0" use-isomorphic-layout-effect "^1.2.0" -react-simplemde-editor@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/react-simplemde-editor/-/react-simplemde-editor-5.2.0.tgz#7a4c8b97e4989cb129b45ba140145d71bdc0684e" - integrity sha512-GkTg1MlQHVK2Rks++7sjuQr/GVS/xm6y+HchZ4GPBWrhcgLieh4CjK04GTKbsfYorSRYKa0n37rtNSJmOzEDkQ== - dependencies: - "@types/codemirror" "~5.60.5" - react-style-singleton@^2.2.2, react-style-singleton@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.3.tgz#4265608be69a4d70cfe3047f2c6c88b2c3ace388" @@ -4127,9 +4411,9 @@ react-window@1.8.11: memoize-one ">=3.1.1 <6" react@^19.2.7: - version "19.2.7" - resolved "https://registry.yarnpkg.com/react/-/react-19.2.7.tgz#1f47a1bfc06f8ec885752c6f4af14369a9f8260b" - integrity sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ== + version "19.2.8" + resolved "https://registry.yarnpkg.com/react/-/react-19.2.8.tgz#a80663dbb58d69c6fe3fd291d3cb324e8a7dff2d" + integrity sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw== readable-stream@^3.4.0: version "3.6.2" @@ -4196,11 +4480,16 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== -reselect@5.2.0, reselect@^5.1.0: +reselect@5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/reselect/-/reselect-5.2.0.tgz#f380ef7664332d26ea06c1cba04bdbbdcaa955f1" integrity sha512-AgZ3UOZm3YndfrJ4OYjgrT7bmCm/1iqkjvEfH/oYjzh6PD2qw4QuT3jjnXIrpdt4MTpMXclMT3lXbmRY+XRakw== +reselect@^5.1.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/reselect/-/reselect-5.3.0.tgz#0a3e3ed4436bdf2ab7c5e0f392dab2c062595d61" + integrity sha512-XGoLeRAVzUTcJ1qkxPQhDJyIZ5d6zzZD9nT7AEZOaaU9UbWclhycElmhO+VD5bFeLuzhPBaOV2oXC8uG35ZSpg== + resize-observer-polyfill@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" @@ -4257,40 +4546,45 @@ rollup-plugin-license@^3.7.1: spdx-satisfies "^5.0.1" rollup@^4.43.0, rollup@^4.61.1: - version "4.62.4" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.62.4.tgz#96d2e62070f0b0ac63424edd0c93a7fb864ef069" - integrity sha512-RXOqwaPsBGjMNMa4sQjDjHieHEZDFoj/Rdr46l2MU5DfEs16wHJPC2RPTPHWhNl+M3aI472LLqFkFKut4SblOg== + version "4.63.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.63.1.tgz#a9b96d5b2558d034babb12ad8b67a043bc870ac4" + integrity sha512-3Df9jsstwhccuEfmAMi9l8XUh/GOkVObmFTU7CCVBysEbcOZLl84jCtaAZMcPiMz2EGKsATzQcU+Xr3n/wU6cg== dependencies: "@types/estree" "1.0.9" optionalDependencies: "@napi-rs/lzma-linux-x64-gnu" "1.5.1" - "@rollup/rollup-android-arm-eabi" "4.62.4" - "@rollup/rollup-android-arm64" "4.62.4" - "@rollup/rollup-darwin-arm64" "4.62.4" - "@rollup/rollup-darwin-x64" "4.62.4" - "@rollup/rollup-freebsd-arm64" "4.62.4" - "@rollup/rollup-freebsd-x64" "4.62.4" - "@rollup/rollup-linux-arm-gnueabihf" "4.62.4" - "@rollup/rollup-linux-arm-musleabihf" "4.62.4" - "@rollup/rollup-linux-arm64-gnu" "4.62.4" - "@rollup/rollup-linux-arm64-musl" "4.62.4" - "@rollup/rollup-linux-loong64-gnu" "4.62.4" - "@rollup/rollup-linux-loong64-musl" "4.62.4" - "@rollup/rollup-linux-ppc64-gnu" "4.62.4" - "@rollup/rollup-linux-ppc64-musl" "4.62.4" - "@rollup/rollup-linux-riscv64-gnu" "4.62.4" - "@rollup/rollup-linux-riscv64-musl" "4.62.4" - "@rollup/rollup-linux-s390x-gnu" "4.62.4" - "@rollup/rollup-linux-x64-gnu" "4.62.4" - "@rollup/rollup-linux-x64-musl" "4.62.4" - "@rollup/rollup-openbsd-x64" "4.62.4" - "@rollup/rollup-openharmony-arm64" "4.62.4" - "@rollup/rollup-win32-arm64-msvc" "4.62.4" - "@rollup/rollup-win32-ia32-msvc" "4.62.4" - "@rollup/rollup-win32-x64-gnu" "4.62.4" - "@rollup/rollup-win32-x64-msvc" "4.62.4" + "@rollup/rollup-android-arm-eabi" "4.63.1" + "@rollup/rollup-android-arm64" "4.63.1" + "@rollup/rollup-darwin-arm64" "4.63.1" + "@rollup/rollup-darwin-x64" "4.63.1" + "@rollup/rollup-freebsd-arm64" "4.63.1" + "@rollup/rollup-freebsd-x64" "4.63.1" + "@rollup/rollup-linux-arm-gnueabihf" "4.63.1" + "@rollup/rollup-linux-arm-musleabihf" "4.63.1" + "@rollup/rollup-linux-arm64-gnu" "4.63.1" + "@rollup/rollup-linux-arm64-musl" "4.63.1" + "@rollup/rollup-linux-loong64-gnu" "4.63.1" + "@rollup/rollup-linux-loong64-musl" "4.63.1" + "@rollup/rollup-linux-ppc64-gnu" "4.63.1" + "@rollup/rollup-linux-ppc64-musl" "4.63.1" + "@rollup/rollup-linux-riscv64-gnu" "4.63.1" + "@rollup/rollup-linux-riscv64-musl" "4.63.1" + "@rollup/rollup-linux-s390x-gnu" "4.63.1" + "@rollup/rollup-linux-x64-gnu" "4.63.1" + "@rollup/rollup-linux-x64-musl" "4.63.1" + "@rollup/rollup-openbsd-x64" "4.63.1" + "@rollup/rollup-openharmony-arm64" "4.63.1" + "@rollup/rollup-win32-arm64-msvc" "4.63.1" + "@rollup/rollup-win32-ia32-msvc" "4.63.1" + "@rollup/rollup-win32-x64-gnu" "4.63.1" + "@rollup/rollup-win32-x64-msvc" "4.63.1" fsevents "~2.3.2" +rope-sequence@^1.3.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/rope-sequence/-/rope-sequence-1.3.4.tgz#df85711aaecd32f1e756f76e43a415171235d425" + integrity sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ== + safe-buffer@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -4495,9 +4789,9 @@ supports-preserve-symlinks-flag@^1.0.0: integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== tabbable@^6.0.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-6.4.0.tgz#36eb7a06d80b3924a22095daf45740dea3bf5581" - integrity sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg== + version "6.5.0" + resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-6.5.0.tgz#a65101385a4fd6cbd580b7546da0170f307b535d" + integrity sha512-wieBHXygIm7OyQOu5hQlkk62/WyCFYGlWg7L6/ZCUZwx0o398Zkn4pVmMyfYhfMG8kGrj/Krt8eIk6UKC6VzwA== tagged-tag@^1.0.0: version "1.0.0" @@ -4545,6 +4839,11 @@ tinyglobby@^0.2.15: fdir "^6.5.0" picomatch "^4.0.4" +tiptap-extension-resizable-image@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tiptap-extension-resizable-image/-/tiptap-extension-resizable-image-2.1.0.tgz#26573bcddfeeb06067be6f7c5ace2573b14661b4" + integrity sha512-uvdY/mTHMZ3EF3Z+b61y1htOUg8oF4TiepNFF1pYRg/KITYoYSteF5/L2/qtlZF9SMrzzwnrtRFQFzn/qBj7qQ== + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -4586,11 +4885,6 @@ typescript@^6: resolved "https://registry.yarnpkg.com/typescript/-/typescript-6.0.3.tgz#90251dc007916e972786cb94d74d15b185577d21" integrity sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw== -typo-js@*: - version "1.3.2" - resolved "https://registry.yarnpkg.com/typo-js/-/typo-js-1.3.2.tgz#03a0e0e20b06fede619ffee16d5f4e3e032b8eb2" - integrity sha512-Z1YkJ7IIYNrFeOxAlHUercY4Q2I+PhYD/3VkWpJGy/Oqudy3bFpNcQxnv6Oa9fTSXCHPGz1eDoX1bZYm2Z891A== - ufo@^1.6.3: version "1.6.4" resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.6.4.tgz#7a8fb875fcc6382d2c7d0b3692738b0500a92467" @@ -4653,10 +4947,10 @@ unplugin@^2.3.2: picomatch "^4.0.3" webpack-virtual-modules "^0.6.2" -update-browserslist-db@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz#64d76db58713136acbeb4c49114366cc6cc2e80d" - integrity sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w== +update-browserslist-db@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.3.2.tgz#9d99fbff56c50bb11ba5fd35cece5916da595836" + integrity sha512-UQ+MSxlhRm1bzjhU+DcuXfjFO1FzNtqhK5+9Yvlp90ItDLk5vT932A0rFu619nf7RVS+Y/VeaUW1jaRDqZ8VJw== dependencies: escalade "^3.2.0" picocolors "^1.1.1" @@ -4786,11 +5080,11 @@ vite-plugin-istanbul@^9.0.1: fsevents "~2.3.3" vscode-uri@^3.0.8: - version "3.1.0" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.1.0.tgz#dd09ec5a66a38b5c3fffc774015713496d14e09c" - integrity sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ== + version "3.2.0" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.2.0.tgz#1cb1fd3cee7426b66732afc3fb86343d596d5fb4" + integrity sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg== -w3c-keyname@^2.2.4: +w3c-keyname@^2.2.0, w3c-keyname@^2.2.4: version "2.2.8" resolved "https://registry.yarnpkg.com/w3c-keyname/-/w3c-keyname-2.2.8.tgz#7b17c8c6883d4e8b86ac8aba79d39e880f8869c5" integrity sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ== @@ -4889,6 +5183,6 @@ zod@^3.22.4: integrity sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ== zustand@^5.0.14: - version "5.0.14" - resolved "https://registry.yarnpkg.com/zustand/-/zustand-5.0.14.tgz#18216c24fcb980cf36898f9c57520e67b1f77855" - integrity sha512-/8tAspM5LMPr28b3fwLYrtdj77ECpfZviaP75CMTnwO8ISyaE4GDIG/9rDDYq/cH9D2Xw2A2RXglLInmVBQB/g== + version "5.0.15" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-5.0.15.tgz#42bddf35647cb80a818a8943a69f6618c126fcfe" + integrity sha512-MpSEjRiBkA9crSYeOUH32rJC7SVqAbm0Fqcqge/bUi2PPoLcBWKOsG+C8mevmpr8TwXHBVkChbbJiyvkE+i/3A== diff --git a/tasks.py b/tasks.py index cfed52187f..5970d6b80f 100644 --- a/tasks.py +++ b/tasks.py @@ -1767,6 +1767,7 @@ def test_translations(c): 'translations': 'Compile translations before running tests', 'keepdb': 'Keep the test database after running tests (default = False)', 'pytest': 'Use pytest to run tests', + 'parallel': 'Set number of parallel test processes (default = off)', 'verbosity': 'Verbosity level for test output (default = 1)', } ) @@ -1781,6 +1782,7 @@ def test( translations: bool = False, keepdb: bool = False, pytest: bool = False, + parallel: Optional[int] = None, verbosity: int = 1, ): """Run unit-tests for InvenTree codebase. @@ -1831,6 +1833,9 @@ def test( cmd += f' --verbosity {verbosity}' + if parallel: + cmd += f' --parallel {parallel}' + if coverage: # Run tests within coverage environment, and generate report run(c, f'coverage run {manage_py_path()} {cmd}')