Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions desktop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@tauri-apps/plugin-notification": "^2.3.3",
"@tauri-apps/plugin-opener": "^2.5.3",
"@tauri-apps/plugin-os": "^2.3.2",
"@tauri-apps/plugin-stronghold": "^2.3.1",
"@tiptap/extension-emoji": "^3.20.0",
"@vue/apollo-composable": "^4.2.2",
"@vueuse/nuxt": "^14.2.1",
Expand Down
4 changes: 4 additions & 0 deletions desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tauri-plugin-log = "2"
tauri-plugin-notification = "2"
tauri-plugin-opener = "2"
tauri-plugin-os = "2"
tauri-plugin-stronghold = "2"
thiserror = "2"
tokio = { version = "1", features = ["time"] }
tokio-stream = "0.1.18"
Expand All @@ -45,3 +46,6 @@ tauri-plugin-single-instance = "2"

[build-dependencies]
tauri-build = { version = "2.5.4", features = [] }

[profile.dev.package.scrypt]
opt-level = 3
9 changes: 6 additions & 3 deletions desktop/src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "enables the default permissions",
"windows": ["main"],
"windows": [
"main"
],
"permissions": [
"core:default",
"clipboard-manager:default",
Expand All @@ -20,6 +22,7 @@
"core:window:allow-is-maximized",
"core:window:allow-start-dragging",
"core:window:allow-toggle-maximize",
"decorum:allow-show-snap-overlay"
"decorum:allow-show-snap-overlay",
"stronghold:default"
]
}
}
4 changes: 3 additions & 1 deletion desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ use crate::state::scheduler::SchedulerState;
#[cfg_attr(mobile, tauri::mobile_entry_point)]
#[tokio::main]
pub async fn run() {
let mut builder = tauri::Builder::default().plugin(tauri_plugin_opener::init());
let mut builder = tauri::Builder::default()
.plugin(tauri_plugin_stronghold::Builder::new(|pass| todo!()).build())
.plugin(tauri_plugin_opener::init());

#[cfg(desktop)]
{
Expand Down
1 change: 0 additions & 1 deletion kernel/bindings/workspace_preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export type Model = {
identifier: string;
firstName: string;
lastName: string;
email: string;
createdAt: string;
updatedAt: string;
workspaceIdentifier: string | null;
Expand Down
10 changes: 6 additions & 4 deletions kernel/migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ mod m20260331_000000_add_workspace_flags;
mod m20260403_000000_add_workspace_security;
mod m20260501_000000_fix_sync_queue_uuid_triggers;
mod m20260518_000000_remove_email_unique_constraint_from_user_preference;
mod m20260527_110010_rename_user_prefernece_table_to_workspace_preference;
mod m20260527_110634_create_user_prefernece_table;
mod m20260527_110010_rename_user_preference_table_to_workspace_preference;
mod m20260527_110634_create_user_preference_table;
mod m20260527_171026_remove_email_from_workspace_preference;

pub use sea_orm_migration::prelude::*;

Expand Down Expand Up @@ -66,9 +67,10 @@ impl MigratorTrait for Migrator {
m20260518_000000_remove_email_unique_constraint_from_user_preference::Migration,
),
Box::new(
m20260527_110010_rename_user_prefernece_table_to_workspace_preference::Migration,
m20260527_110010_rename_user_preference_table_to_workspace_preference::Migration,
),
Box::new(m20260527_110634_create_user_prefernece_table::Migration),
Box::new(m20260527_110634_create_user_preference_table::Migration),
Box::new(m20260527_171026_remove_email_from_workspace_preference::Migration),
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use sea_orm_migration::{prelude::*, schema::*};

#[derive(DeriveMigrationName)]
pub struct Migration;

#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table("workspace_preferences")
.drop_column_if_exists("email")
.to_owned(),
)
.await
}

async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table("workspace_preferences")
.add_column(string("email"))
.to_owned(),
)
.await
}
}
1 change: 1 addition & 0 deletions kernel/src/adapters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ pub mod reminder;
pub mod snippets;
pub mod sync_queue;
pub mod todo;
pub mod user_preferences;
pub mod workspace;
pub mod workspace_preferences;
35 changes: 35 additions & 0 deletions kernel/src/adapters/user_preferences.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
use chrono::Utc;
use sea_orm::ActiveValue::Set;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

use crate::entities::{self, user_preferences::ActiveModel};

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CreateUserPreferences {
pub master_first_name: String,
pub master_last_name: String,
pub master_email: String,
}

impl Into<entities::user_preferences::ActiveModel> for CreateUserPreferences {
fn into(self) -> entities::user_preferences::ActiveModel {
ActiveModel {
identifier: Set(Uuid::new_v4()),
master_first_name: Set(self.master_first_name),
master_last_name: Set(self.master_last_name),
master_email: Set(self.master_email),
created_at: Set(Utc::now().fixed_offset()),
updated_at: Set(Utc::now().fixed_offset()),
}
}
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct UpdateUserPreferences {
pub master_first_name: Option<String>,
pub master_last_name: Option<String>,
pub master_email: Option<String>,
}
1 change: 0 additions & 1 deletion kernel/src/adapters/workspace_preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ impl Into<entities::workspace_preferences::ActiveModel> for CreateUserPreference
identifier: Set(Uuid::new_v4()),
first_name: Set(self.first_name),
last_name: Set(self.last_name),
email: Set(self.email),
workspace_identifier: Set(None),
created_at: Set(Utc::now().fixed_offset()),
updated_at: Set(Utc::now().fixed_offset()),
Expand Down
1 change: 0 additions & 1 deletion kernel/src/entities/mysql/workspace_preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub struct Model {
pub identifier: Vec<u8>,
pub first_name: String,
pub last_name: String,
pub email: String,
pub created_at: DateTimeUtc,
pub updated_at: DateTimeUtc,
pub workspace_identifier: Option<String>,
Expand Down
1 change: 0 additions & 1 deletion kernel/src/entities/postgres/workspace_preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub struct Model {
pub identifier: Uuid,
pub first_name: String,
pub last_name: String,
pub email: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub workspace_identifier: Option<Uuid>,
Expand Down
1 change: 0 additions & 1 deletion kernel/src/entities/sqlite/workspace_preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub struct Model {
pub identifier: Uuid,
pub first_name: String,
pub last_name: String,
pub email: String,
pub workspace_identifier: Option<Uuid>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
Expand Down
3 changes: 2 additions & 1 deletion kernel/src/repositories/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod reminder;
pub mod snippets;
pub mod sync_queue;
pub mod todo;
pub mod user_preference;
pub mod user_preferences;
pub mod workspace;
pub mod workspace_manager;
pub mod workspace_preference;
2 changes: 1 addition & 1 deletion kernel/src/repositories/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pub use super::{
bookmarks::BookmarkRepositoryExt, notes::NotesRepositoryExt,
recycle_bin::RecycleBinRepositoryExt, reminder::ReminderRepositoryExt,
snippets::SnippetRepositoryExt, sync_queue::SyncQueueRepositoryExt, todo::TodoRepositoryExt,
user_preference::UserPreferenceRepositoryExt, workspace::WorkspaceRepositoryExt,
workspace::WorkspaceRepositoryExt, workspace_preference::WorkspacePreferenceRepositoryExt,
};
Loading
Loading