-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: preparation for resuming activities from intermissions and oth…
…er use cases (#43) * fix: filter for activities to exclude intermissions from showing up in resume Signed-off-by: simonsan <[email protected]> (cherry picked from commit aca2b9d2b2bc4bfee8f4a64c7a1daf1ac7e55e2c) * feat: introduce symbols to easier differentiate the ActivityKinds when being displayed to the user Signed-off-by: simonsan <[email protected]> (cherry picked from commit 57ebebf67ad49f4f27e2f230c78ef39bdba0b564) * test: make tests pass again Signed-off-by: simonsan <[email protected]> * refactor: use btreemap for easier access via ids and use ids in config table headers Signed-off-by: simonsan <[email protected]> * refactor: rename to rwlock error to better reflect utilization Signed-off-by: simonsan <[email protected]> --------- Signed-off-by: simonsan <[email protected]>
- Loading branch information
Showing
29 changed files
with
2,105 additions
and
837 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pub mod hold; | ||
pub mod resume; | ||
|
||
use getset::Getters; | ||
use typed_builder::TypedBuilder; | ||
|
||
use crate::{HoldOptions, PaceDateTime}; | ||
|
||
/// Options for ending an activity | ||
#[derive(Debug, Clone, PartialEq, TypedBuilder, Eq, Hash, Default, Getters)] | ||
#[getset(get = "pub")] | ||
pub struct EndOptions { | ||
/// The end time | ||
#[builder(default, setter(into))] | ||
end_time: PaceDateTime, | ||
} | ||
|
||
impl From<HoldOptions> for EndOptions { | ||
fn from(hold_opts: HoldOptions) -> Self { | ||
Self { | ||
end_time: *hold_opts.begin_time(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use getset::Getters; | ||
use typed_builder::TypedBuilder; | ||
|
||
use crate::{IntermissionAction, PaceDateTime}; | ||
|
||
/// Options for holding an activity | ||
#[derive(Debug, Clone, PartialEq, TypedBuilder, Eq, Hash, Default, Getters)] | ||
#[getset(get = "pub")] | ||
pub struct HoldOptions { | ||
/// The action to take on the intermission | ||
#[builder(default)] | ||
action: IntermissionAction, | ||
|
||
/// The start time of the intermission | ||
#[builder(default, setter(into))] | ||
begin_time: PaceDateTime, | ||
|
||
/// The reason for holding the activity | ||
#[builder(default, setter(into))] | ||
reason: Option<String>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.