Port TextEditorView and DnDUploader to spina.

Review Request #13115 — Created June 19, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

In preparation for integrating the rich text toolbar, this change ports
our TextEditorView and DnDUploader to TypeScript via spina.

This also fixes one issue I discovered where if the only thing you've
done with a text editor is upload an image, it won't think the editor is
dirty and so saving discards the contents.

  • Ran js-tests.
  • Used drag and drop to upload files into a text editor.
Summary ID
Port TextEditorView and DnDUploader to spina.
In preparation for integrating the rich text toolbar, this change ports our `TextEditorView` and `DnDUploader` to TypeScript via spina. This also fixes one issue I discovered where if the only thing you've done with a text editor is upload an image, it won't think the editor is dirty and so saving discards the contents. Testing Done: - Ran js-tests. - Used drag and drop to upload files into a text editor.
55b6738044bc3e3e68c8495d802d2c6f4c3906c0
Description From Last Updated

Sorting imports is weird, but I think we're doing by module name? Same elsewhere.

chipx86chipx86

Missing docs.

chipx86chipx86

These should be in alphabetical order.

chipx86chipx86

Should we type this TextEditorViewOptions?

chipx86chipx86

Missing docs.

chipx86chipx86
david
chipx86
  1. 
      
  2. Sorting imports is weird, but I think we're doing by module name?

    Same elsewhere.

    1. I'm not really sure what to do here. We could sort alphabetically by the full module path, but that ends up being a lot of careful manual work and doesn't seem to buy us much. What I've been doing is just sorting by the imported symbol name, which lets me mostly do :$!sort

    2. Sorting by imported symbol name could be weird when you're importing more than one thing from a module, but I guess this wouldn't happen that often.

    3. Yeah I don't love the situation with JavaScript module imports. I don't think importing by symbol makes sense for cases where we're importing multiple things (doesn't happen in these simpler cases, but does happen for more complex ones). Module name I think makes more sense, but yeah, it's an annoying amount of work.

      :sort breaks down when dealing with multi-line imports anyway.

      There's an ESLint plugin I was looking at that adds a lot of import/export-related checks. We should probably use it for just the import group separations if nothing else:

      https://github.com/import-js/eslint-plugin-import/blob/a257df9fe0683289c51e3ffe7b64ec0062fd69a8/docs/rules/order.md

    4. OK, going to do a separate cleanup change for all .ts files.

  3. These should be in alphabetical order.

  4. Should we type this TextEditorViewOptions?

  5. reviewboard/static/rb/js/ui/views/textEditorView.ts (Diff revision 2)
     
     
     
     
     
     
     

    Missing docs.

  6. 
      
david
maubin
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-6.x (a0ef5d1)
Loading...