mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-23 23:30:54 +00:00
[PUI] Notes editor (#7284)
* Install mdxeditor * Setup basic toolbar * Refactoring * Add placeholder for image upload * Add fields to link uploaded notes to model instances * Add custom delete method for InvenTreeNotesMixin * Refactor CUI notes editor - Upload model type and model ID information * Enable image uplaod for PUI editor * Update <NotesEditor> component * Fix import * Add button to save notes * Prepend the host name to relative image URLs * Disable image resize * Add notifications * Add playwright tests * Enable "read-only" mode for notes * Typo fix * Styling updates to the editor * Update yarn.lock * Bump API version * Update migration * Remove duplicated value * Improve toggling between edit mode * Fix migration * Fix migration * Unit test updates - Click on the right buttons - Add 'key' properties * Remove extraneous key prop * fix api version * Add custom serializer mixin for 'notes' field - Pop the field for 'list' endpoints - Keep for detail * Update to NotesEditor * Add unit test
This commit is contained in:
src
backend
InvenTree
InvenTree
build
common
company
order
serializers.py
templates
part
stock
templates
js
translated
frontend
@ -196,3 +196,31 @@ test('PUI - Pages - Part - Parameters', async ({ page }) => {
|
||||
|
||||
await page.getByRole('button', { name: 'Cancel' }).click();
|
||||
});
|
||||
|
||||
test('PUI - Pages - Part - Notes', async ({ page }) => {
|
||||
await doQuickLogin(page);
|
||||
|
||||
await page.goto(`${baseUrl}/part/69/notes`);
|
||||
|
||||
// Enable editing
|
||||
await page.getByLabel('toggle-notes-editing').click();
|
||||
|
||||
// Enter some text
|
||||
await page
|
||||
.getByRole('textbox')
|
||||
.getByRole('paragraph')
|
||||
.fill('This is some data\n');
|
||||
|
||||
// Save
|
||||
await page.getByLabel('save-notes').click();
|
||||
await page.getByText('Notes saved successfully').waitFor();
|
||||
|
||||
// Navigate away from the page, and then back
|
||||
await page.goto(`${baseUrl}/stock/location/index/`);
|
||||
await page.waitForURL('**/platform/stock/location/**');
|
||||
await page.getByRole('tab', { name: 'Location Details' }).waitFor();
|
||||
await page.goto(`${baseUrl}/part/69/notes`);
|
||||
|
||||
// Check that the original notes are still present
|
||||
await page.getByText('This is some data').waitFor();
|
||||
});
|
||||
|
Reference in New Issue
Block a user