Skip to content
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

[PUI] Notes editor #7284

Merged
merged 42 commits into from
Jun 4, 2024
Merged

Conversation

SchrodingersGat
Copy link
Member

@SchrodingersGat SchrodingersGat commented May 21, 2024

TODO

  • Update unit tests for API endpoints
  • Playwright tests for notes components
  • OR prevent image resizing (for now)?
  • Allow uploaded images to be linked to specific model instances
  • Auto-delete related notes when the linked instance is removed
  • Update demo dataset with notes, uploaded image data, etc

Future Work

  • Allow image resizing (requires that we accept a subset of HTML tags on the server)
  • Consider moving "notes" to own API endpoint (like "metadata") - as potentially quite data heavy

@SchrodingersGat SchrodingersGat added refactor user interface User interface Platform UI Related to the React based User Interface labels May 21, 2024
Copy link

netlify bot commented May 21, 2024

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 9e483ab
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/665ee6a48c7347000874890a
😎 Deploy Preview https://deploy-preview-7284--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 89 (no change from production)
Best Practices: 92 (no change from production)
SEO: 70 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 77.47748% with 25 lines in your changes missing coverage. Please review.

Project coverage is 83.36%. Comparing base (a5fa5f8) to head (9e483ab).

Files Patch % Lines
...rc/frontend/src/components/editors/NotesEditor.tsx 76.78% 12 Missing and 1 partial ⚠️
src/backend/InvenTree/common/validators.py 30.00% 7 Missing ⚠️
src/backend/InvenTree/InvenTree/models.py 71.42% 2 Missing ⚠️
...nTree/common/migrations/0023_auto_20240602_1332.py 0.00% 2 Missing ⚠️
src/frontend/src/pages/company/CompanyDetail.tsx 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7284      +/-   ##
==========================================
- Coverage   83.84%   83.36%   -0.48%     
==========================================
  Files        1055     1056       +1     
  Lines       46276    47007     +731     
  Branches     1390     1390              
==========================================
+ Hits        38799    39187     +388     
- Misses       7113     7454     +341     
- Partials      364      366       +2     
Flag Coverage Δ
backend 85.14% <78.84%> (-0.01%) ⬇️
pui 65.72% <76.27%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matmair
Copy link
Contributor

matmair commented May 21, 2024

@SchrodingersGat what is the difference between MDXEditor and the editor we are currently using?

@SchrodingersGat SchrodingersGat added this to the 0.16.0 milestone May 23, 2024
@wolflu05
Copy link
Contributor

@SchrodingersGat what is the difference between MDXEditor and the editor we are currently using?

I would be really interested on the answer as well.

@SchrodingersGat
Copy link
Member Author

SchrodingersGat commented May 27, 2024

  • This new editor has a few additional features (in particular the ability to resize images) which I found appealing, and it much more in line with the visual look and feel of the new interface.
  • It is also actively developed.
  • Due to the "/platform/" (or any other) prefix it is hard to display uploaded images in the older editor. There is a nice workaround in MDXEditor

However diving into "image resize" a bit more, that requires custom <img> tags (currently we disallow any html tags) and so would require a back-end change anyhow

@SchrodingersGat
Copy link
Member Author

As a separate issue I would like to explore removing the "notes" from the API endpoints where they currently reside, and put them into separate endpoints (like "metadata"). The "notes" fields can potentially house a lot of data and I do not see the benefit of serializing each notes field for every item when we are generating a list of items...

SchrodingersGat added a commit to inventree/inventree-python that referenced this pull request Jun 4, 2024
SchrodingersGat added a commit to inventree/inventree-python that referenced this pull request Jun 4, 2024
* Update API level for "modern" report templates

* Update unit tests

Ref: inventree/InvenTree#7284
@SchrodingersGat SchrodingersGat merged commit 2b8e8e5 into inventree:master Jun 4, 2024
27 of 28 checks passed
@SchrodingersGat SchrodingersGat deleted the notes-editor branch June 4, 2024 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform UI Related to the React based User Interface refactor user interface User interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[React] New markdown editor
3 participants