-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Refactor] Notes #11971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
SchrodingersGat
wants to merge
98
commits into
inventree:master
Choose a base branch
from
SchrodingersGat:block-notes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[Refactor] Notes #11971
Changes from 87 commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
eff83e7
Install packages for blocknote
SchrodingersGat 01bc34e
Add new notes editor using blocknote
SchrodingersGat 71d51ff
Add new generic "notes" model
SchrodingersGat 176733d
Add basic tab group for switching notes
SchrodingersGat 1078475
API / serializer updates
SchrodingersGat 19c497f
Merge commit '99358eb4e7e4b051fd35c0b72c5d75e11ea5f2ec' into block-notes
SchrodingersGat 8815861
Add notes fetch
SchrodingersGat 6df13fe
Add note mixin support for existing models
SchrodingersGat 51d8468
Fix serializer
SchrodingersGat a0e528a
Create new notes
SchrodingersGat bc197f9
Omit migration tests from code coverage
SchrodingersGat ac8e8d9
Add "no notes" item
SchrodingersGat ab0da25
Add "primary" field to Note model
SchrodingersGat c18fd25
Update serializer
SchrodingersGat d77be24
Add unit test
SchrodingersGat c7d11dc
Mark content field as 'safe'
SchrodingersGat 9e8764d
Fix conflict (for now)
SchrodingersGat fd3d64d
Merge branch 'master' into block-notes
SchrodingersGat df340e3
Load notes into editor
SchrodingersGat 689bd1f
Refactor save UX
SchrodingersGat 36e81c4
Sanitize before uploading
SchrodingersGat 136c925
remove old editor
SchrodingersGat 0c1aa65
Remove old deps
SchrodingersGat 7315c34
Merge branch 'block-notes' of github.com:SchrodingersGat/InvenTree in…
SchrodingersGat 5cd7bfa
Merge commit '27ca0836e7c7e46ebb41ea98d507972ae7a6b018' into block-notes
SchrodingersGat 38e3c86
Merge commit '749c4715ee022bdb39b500f5c3776c1ee18411e3' into block-notes
SchrodingersGat 4338920
Merge commit 'dd1edce2e59172c86e85fdd09d6ed01d3fcfefe4' into block-notes
SchrodingersGat 754a4c2
Fix migration conflict
SchrodingersGat 8377f53
Run nh3 cleaner over backend notes
SchrodingersGat 9e91663
Update note accessors
SchrodingersGat 5813c4b
edit / delete existing notes from the UI
SchrodingersGat d798aac
Layout tweaks
SchrodingersGat 407ba3f
Display note info
SchrodingersGat d99487b
Support user locale
SchrodingersGat 488f558
Add unit testing for HTML content
SchrodingersGat 29202f6
Observe color mode
SchrodingersGat 8b99c33
Merge branch 'master' into block-notes
SchrodingersGat 4fff7ed
Add link between Note and NotesImage
SchrodingersGat 0df677d
Ensure image file is deleted when NotesImage is deleted
SchrodingersGat 8f36287
Add support for image upload in editor
SchrodingersGat d305ec2
Skeleton for data migration
SchrodingersGat 1260de6
Updates
SchrodingersGat 24e8fad
Update data migration
SchrodingersGat c2e1893
Remove validator
SchrodingersGat d93d5f9
Updated API endpoints for NotesImage model
SchrodingersGat 725ef04
Update server side sanitizing
SchrodingersGat c58b7b8
Specify max field length
SchrodingersGat 618e368
Remove old fields from NotesImage model
SchrodingersGat cdd1b1d
Refactor clean_string
SchrodingersGat be132bf
Remove obsolete task
SchrodingersGat 256cae2
Remove legacy "notes" field from older models
SchrodingersGat 9f77ae2
Adjust search params when switching notes
SchrodingersGat 50b67ff
Remove NotesFieldMixin
SchrodingersGat 36bc444
Change editor
SchrodingersGat c37c1e6
Resizable image support
SchrodingersGat 5c4f082
Support tables
SchrodingersGat 799e57c
Add table style
SchrodingersGat 277e22a
Adjust header actions
SchrodingersGat 8396a9d
Add data migration for SalesOrderShipment notes
SchrodingersGat 73a3218
Adjust back-end sanitizing
SchrodingersGat f754444
Adjust
SchrodingersGat 2b57413
Use subtle editor variant
SchrodingersGat 664eed1
Move undo/redo
SchrodingersGat 36006c6
Enhance editing logic
SchrodingersGat d1b3746
Merge branch 'master' into block-notes
SchrodingersGat 6a5e606
Add report tags for notes
SchrodingersGat dc9e23c
Add unit test for note image cleanup
SchrodingersGat 9ecaf2c
Render note to HTML
SchrodingersGat c0deb92
Merge commit 'bc03f349085582e99606b94ff9c4cded905aeb1b' into block-notes
SchrodingersGat 42931fd
Fix migration order
SchrodingersGat 48cd60b
Adjust migration text
SchrodingersGat 09ab375
Merge commit '00ad041e1b65754460c9fb9b6242f6e4e9295d2c' into block-notes
SchrodingersGat 8d4c201
Fix "dirty" trigger on notes
SchrodingersGat 55a39b2
Prevent navigate from dirty notes
SchrodingersGat bf675f1
Add documentation
SchrodingersGat b4bd688
Prevent image clicking if not in editing mode
SchrodingersGat 2d8fd18
Merge branch 'master' into block-notes
SchrodingersGat 40c2775
Merge commit '956468eb847754e701d207bae2a51a6a00ca7d56' into block-notes
SchrodingersGat 4f41ebb
Merge branch 'master' into block-notes
SchrodingersGat 8bf2152
Merge commit 'd38af61ba2fb3c87143da57ddd92bc4845f85a7c' into block-notes
SchrodingersGat d7af743
Merge branch 'block-notes' of github.com:SchrodingersGat/InvenTree in…
SchrodingersGat 38d8965
Merge commit '47c6906a74f41eed5b56f4dc43ea0d4e20415237' into block-notes
SchrodingersGat a7ae8c0
Update API
SchrodingersGat 8bd9aa7
Update migration files
SchrodingersGat 11e55fc
Merge branch 'master' into block-notes
SchrodingersGat 05514ec
Fix migrations
SchrodingersGat b2cece1
Merge branch 'block-notes' of github.com:SchrodingersGat/InvenTree in…
SchrodingersGat 2456101
remove notes from test fixtures
matmair 5d49051
remove notes field that does not exsist anymore
matmair 4bc9913
add missing ruleset
matmair 1366da4
fix assertation
matmair 856389b
fix assertation
matmair bb0b82d
Update docs/docs/concepts/notes.md
SchrodingersGat df9786f
Remove blocknote deps
SchrodingersGat 09c1aaa
Merge branch 'master' into block-notes
SchrodingersGat 550a7ab
Move old helper functions
SchrodingersGat f6cde30
Revert change
SchrodingersGat a46bb39
Fix note image URL
SchrodingersGat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| --- | ||
| 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 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. | ||
|
|
||
| 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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.