Skip to content

Commit

Permalink
Add theme field in Account to represent user's screen color theme
Browse files Browse the repository at this point in the history
  • Loading branch information
div-seungha committed Dec 17, 2024
1 parent 61daf7b commit 4f4eb50
Show file tree
Hide file tree
Showing 5 changed files with 283 additions and 22 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [0.33.0] - 2024-12-12

### Added

- Added `Account::theme` field to represent user's selected screen color theme
on the user interface.

### Changed

- Modified `Table::get_patterns` to take a reference to a slice of tuples
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "review-database"
version = "0.33.0"
version = "0.33.1-alpha"
edition = "2021"

[dependencies]
Expand Down
7 changes: 6 additions & 1 deletion src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct Account {
pub name: String,
pub department: String,
pub language: Option<String>,
pub theme: Option<String>,
pub(crate) creation_time: DateTime<Utc>,
pub(crate) last_signin_time: Option<DateTime<Utc>>,
pub allow_access_from: Option<Vec<IpAddr>>,
Expand All @@ -60,6 +61,7 @@ impl Account {
name: String,
department: String,
language: Option<String>,
theme: Option<String>,
allow_access_from: Option<Vec<IpAddr>>,
max_parallel_sessions: Option<u32>,
) -> Result<Self> {
Expand All @@ -72,6 +74,7 @@ impl Account {
role,
name,
department,
theme,
language,
creation_time: now,
last_signin_time: None,
Expand Down Expand Up @@ -170,7 +173,7 @@ impl SaltedPassword {
/// # Errors
///
/// Returns an error if the salt cannot be generated.
fn new_with_hash_algorithm(
pub(crate) fn new_with_hash_algorithm(
password: &str,
hash_algorithm: &PasswordHashAlgorithm,
) -> Result<Self> {
Expand Down Expand Up @@ -292,6 +295,7 @@ mod tests {
None,
None,
None,
None,
);
assert!(account.is_ok());

Expand Down Expand Up @@ -319,6 +323,7 @@ mod tests {
department: String::new(),
name: String::new(),
language: None,
theme: None,
creation_time: Utc::now(),
last_signin_time: None,
allow_access_from: None,
Expand Down
Loading

0 comments on commit 4f4eb50

Please sign in to comment.