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

Add theme field in Account to represent user's screen color theme #383

Merged
merged 1 commit into from
Dec 26, 2024
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
this project adheres to [Semantic this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html). Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased]

### Added

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

Comment on lines +10 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new item should be included in "Unreleased"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, a new version comparison link should be included in the bottom part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to modify the changelog after the latest main rebase. Sorry. I modified it right away and pushed the new commit.

## [0.33.1] - 2024-12-20 ## [0.33.1] - 2024-12-20


### Fixed ### Fixed
Expand Down Expand Up @@ -752,6 +759,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Modified `FtpBruteForce` by adding an `is_internal` field which is a boolean - Modified `FtpBruteForce` by adding an `is_internal` field which is a boolean
indicating whether it is internal or not. indicating whether it is internal or not.


[Unreleased]: https://github.com/petabi/review-database/compare/0.33.1...main
[0.33.1]: https://github.com/petabi/review-database/compare/0.33.0...0.33.1 [0.33.1]: https://github.com/petabi/review-database/compare/0.33.0...0.33.1
[0.33.0]: https://github.com/petabi/review-database/compare/0.32.0...0.33.0 [0.33.0]: https://github.com/petabi/review-database/compare/0.32.0...0.33.0
[0.32.0]: https://github.com/petabi/review-database/compare/0.31.0...0.32.0 [0.32.0]: https://github.com/petabi/review-database/compare/0.31.0...0.32.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
[package] [package]
name = "review-database" name = "review-database"
version = "0.33.1" version = "0.34.0-alpha.1"
edition = "2021" edition = "2021"


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


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