]> uap-core.de Git - note.git/commitdiff
add note type for raw files main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 13 Jul 2026 19:15:35 +0000 (21:15 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 13 Jul 2026 19:15:35 +0000 (21:15 +0200)
application/backend/src/backend.rs
application/backend/src/note.rs
application/note/src/note.rs
application/note/src/window.rs
entity/src/note.rs

index 0550be814dc14b2643f17e40d9ec6d05fb99b11c..e22b06096c68cab88d38f0a793227ae3be781661 100644 (file)
@@ -34,8 +34,6 @@ use sea_orm::{ActiveModelTrait, Database, DatabaseConnection, EntityTrait, Query
 use tokio::runtime::Runtime;
 use std::sync::{Arc};
 use std::thread::JoinHandle;
-use rand::distr::Alphanumeric;
-use rand::RngExt;
 use tokio::fs;
 use tokio::sync::{broadcast, mpsc};
 use tokio::sync::broadcast::error::SendError;
index bd2e32d1cc5d1ec63c896c5ef62aba9c1f57a3a3..f83b71def68a4a3547d70d29cacd92bd98c79659 100644 (file)
@@ -34,6 +34,7 @@ pub fn notetype2ext(t: &NoteType) -> &'static str {
     match t {
         NoteType::PlainTextNote => { ".txt" }
         NoteType::MDTextNote => { ".md" }
+        NoteType::File => { "" }
     }
 }
 
index 171be4cf4d8a47c555cb6486c0c6b684cf9fc8f9..6307b1eb184e01149d7643e82f0a9c0962fda44d 100644 (file)
@@ -152,6 +152,7 @@ impl Note {
         let tab = match model.kind {
             NoteType::PlainTextNote => NoteTypeTabView::TextArea,
             NoteType::MDTextNote => NoteTypeTabView::TextArea,
+            _ => NoteTypeTabView::Empty
         };
         self.note_type.set(tab as i64);
     }
index d51bcef6f2cfc20a5da27655ed862956e63ec763..14269eadbc06fda890a5d331d2ee36aa760318a5 100644 (file)
@@ -297,7 +297,7 @@ fn find_notebook(sourcelist: &UiSourceList<NotebookItem>, collection_id: i32) ->
 }
 
 pub enum NoteTypeTabView {
-    _Empty = 0,
+    Empty = 0,
     TextArea = 1
 }
 
index e0d91dad1db70f6a603b444028cc47fc4461365e..9cf3278e99eab4d5b7f8cd0abf262d9c8d04798f 100644 (file)
@@ -31,6 +31,7 @@ pub enum NoteType {
     #[default]
     PlainTextNote = 0,
     MDTextNote = 1,
+    File = 2
 }
 
 impl ActiveModelBehavior for ActiveModel {}