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 23, 2024
1 parent 7b0cf0f commit e72c4ec
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 29 deletions.
22 changes: 16 additions & 6 deletions CHANGELOG.md
Original file line number 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
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.

## [0.33.1] - 2024-12-20

### Fixed
Expand Down Expand Up @@ -339,7 +346,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Changed the return type of `Store::network_map` to `IndexedTable<Network>`
to enhance security by preventing direct exposure of internal structure.
- Replaced `IndexedMap::get_by_id` function with `Indexed::get_by_id`, providing
a more structured and type-safe result.
a more structured and type-safe result.
- Previously, the function returned a binary representation of the key-value
pair: `Result<(Option<impl AsRef<[u8]>>, Option<impl AsRef<[u8]>>)>`.
- Now, it returns `Result<Option<T>>`, where T is the entry type.
Expand All @@ -355,8 +362,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
more straightforward and human-readable format compared to the raw binary
format exposed by `IndexSet`.
- Replaced the `IndexedTable<Category>::get`, `IndexedTable<Qualifier>::get` and
`IndexedTable<Status>::get` method with the more general function
`IndexedTable<R>::get_by_id`. This change enhances flexibility by allowing
`IndexedTable<Status>::get` method with the more general function
`IndexedTable<R>::get_by_id`. This change enhances flexibility by allowing
retrieval based on any type R rather than being limited to a specific category.
Existing code using get for categories should be updated to use get_by_id with
the appropriate type.
Expand Down Expand Up @@ -398,7 +405,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Added new functions to facilitate insert, remove, and update operations,
ensuring a more controlled and secure template management.
- Introduced `Structured`, `Unstructured`, `StructuredClusteringAlgorithm` and
`UnstructuredClusteringAlgorithm` to describe data stored in `Table<Template>`.
`UnstructuredClusteringAlgorithm` to describe data stored in `Table<Template>`.
- Introduced `TriageResponse` to describe data stored in `IndexedTable<TriageResponse>`.
- Introduced `TriageResponseUpdate` to support `TriageResponse` record update.
- Added new functions to facilitate insert, remove, and update operations,
Expand Down Expand Up @@ -430,7 +437,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
enhance security by preventing direct exposure of `Map`.
- The `get_by_id` method in the `IndexedMap` struct has been updated to return a
key-value pair (`(Vec<u8>, Vec<u8>)`) instead of just the value (`impl
AsRef<[u8]>`). This change accommodates scenarios where the information stored
AsRef<[u8]>`). This change accommodates scenarios where the information stored
in a key may not be present in the value for some Column Families. Previously,
if you called `get_by_id` with a specific ID, you would receive the
corresponding value as `Option<impl AsRef<[u8]>>`. Now, calling `get_by_id`
Expand Down Expand Up @@ -619,7 +626,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Removed `batch_info` and `scores` arguments from `Model::from_storage` function.
These arguments were previously used for custom initialization of the
`batch_info` and `scores` fields within the model. This change means that when
you create a model using `Model::from_storage`, the `batch_info` and `scores`
you create a model using `Model::from_storage`, the `batch_info` and `scores`
fields will now be initialized with their default values. If you previously
relied on custom values for these fields, you will need to update your code accordingly.

Expand Down Expand Up @@ -707,6 +714,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
Please note that if you are currently using a version of the application
earlier than 0.12.0, database migration support has been deprecated and will
no longer be available.

- Users on versions prior to 0.12.0 will need to manually manage their database
schema updates if they choose to continue using these older versions.
- We highly recommend upgrading to the latest version (0.12.0 or later) to
Expand Down Expand Up @@ -744,6 +752,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
code if you have been using the old naming convention. We apologise for any
inconvenience this may cause, but we believe this change will bring greater
consistency and readability to the codebase.

- Removed `src_port` field from `FtpBruteForce` and `LdapBruteForce` events.
to align with the event fields provided by hog.
- Modified `LdapPlainText` fields to appropriate LDAP event fields from wrong
Expand All @@ -752,6 +761,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Modified `FtpBruteForce` by adding an `is_internal` field which is a boolean
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.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
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.1"
version = "0.34.0-alpha.1"
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 e72c4ec

Please sign in to comment.