Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
v0.2.1
Browse files Browse the repository at this point in the history
- Update version to 0.2.1 and make UI improvements.
  • Loading branch information
edfloreshz committed Feb 12, 2024
1 parent 6dedbc4 commit cc0e916
Show file tree
Hide file tree
Showing 22 changed files with 62 additions and 32 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## [0.2.1] - 2024-02-11
- Moved services bar to the top of the sidebar.
- Task details can now be expanded from within each task.

## [0.2.0] - 2023-09-22
- Fixed issue where async tasks would overlap the results in the UI.
- Implemented token refreshing for Microsoft To Do.
Expand Down
3 changes: 2 additions & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "done"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
authors = ["Eduardo Flores <[email protected]>"]
license = "MPL 2.0"
Expand All @@ -26,6 +26,7 @@ tracing-subscriber = "0.3.16"
reqwest = "0.11.18"
futures = "0.3.28"
libset = "0.1.6"
dirs = "5.0.1"

[dependencies.relm4-icons]
version = "0.7.0-alpha.1"
Expand Down
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pkgname=done-git
pkgrel=1
pkgver=0.2.0
pkgver=0.2.1
pkgdesc="Done is a simple to do app that lets you combine your existing set of task providers into one database, easily."
arch=('x86_64')
url="https://github.com/edfloreshz/done"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Our user-friendly app allows you to effortlessly consolidate your existing tasks
|------------|-----------------------------------------|
| Flathub | <a href="https://flathub.org/apps/details/dev.edfloreshz.Done"><img src="https://flathub.org/assets/badges/flathub-badge-en.png" width="150"/></a> |
| AUR | <a href="https://aur.archlinux.org/packages/done"><img src="https://aur.archlinux.org/static/css/archnavbar/aurlogo.png" width="150"></a> |
| Snap | <a href="https://snapcraft.io/done"><img alt="Get it from the Snap Store" src="https://snapcraft.io/static/images/badges/en/snap-store-black.svg" /></a>|

# Build

Expand Down
2 changes: 1 addition & 1 deletion core/src/models/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl From<TodoTask> for Task {
priority: task.importance.into(),
sub_tasks: task
.checklist_items
.unwrap_or(vec![])
.unwrap_or_default()
.iter()
.map(|item| item.clone().into())
.collect(),
Expand Down
4 changes: 3 additions & 1 deletion core/src/services/local/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ use diesel_migrations::{
};
use libset::Config;

use crate::services::microsoft::service::APP_ID;

pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations");
pub const DATABASE_NAME: &str = "dev.edfloreshz.Done.db";

pub struct Database;

impl Database {
fn database_url() -> Result<String> {
let url = Config::new("dev.edfloreshz.done", 1, Some("database"))?
let url = Config::new(APP_ID, 1, Some("database"))?
.path(DATABASE_NAME, libset::FileType::Plain)?;
Ok(url.display().to_string())
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/services/microsoft/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use graph_rs_sdk::{
use reqwest::StatusCode;
use url::Url;

const APP_ID: &str = "dev.edfloreshz.Done";
pub const APP_ID: &str = "dev.edfloreshz.Done";
const CLIENT_ID: &str = "75d8509b-cf9b-4245-9550-1e5f1d7c66e4";
const REDIRECT_URI: &str = "done://msft";

Expand Down Expand Up @@ -89,7 +89,7 @@ impl MicrosoftService {

fn store_token(&mut self, token: AccessToken) -> Result<()> {
keytar::set_password(
"dev.edfloreshz.Done",
APP_ID,
"access_token",
&serde_json::to_string(&token)?,
);
Expand Down Expand Up @@ -165,7 +165,7 @@ impl TodoProvider for MicrosoftService {
}

fn logout(&self) -> anyhow::Result<()> {
keytar::delete_password("dev.edfloreshz.Done", "access_token")?;
keytar::delete_password(APP_ID, "access_token")?;
Ok(())
}

Expand Down
9 changes: 9 additions & 0 deletions data/dev.edfloreshz.Done.metainfo.xml.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ https://hughsie.github.io/oars/index.html
-->
<content_rating type="oars-1.1" />
<releases>
<release version="0.2.1" date="2024-02-11">
<description>
<p>New design!</p>
<ul>
<li>Moved services bar to the top of the sidebar.</li>
<li>Task details can now be expanded from within each task.</li>
</ul>
</description>
</release>
<release version="0.2.0" date="2023-09-21">
<description>
<p>Bug fixes</p>
Expand Down
Binary file modified data/resources/screenshots/about.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/resources/screenshots/dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/resources/screenshots/dark_details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/resources/screenshots/task_details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/resources/screenshots/tasks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h2 class="dark:text-white leading tracking-tight text-gray-900 sm:text-2xl mt-4
</a>
<div class="grid place-content-center text-center">
<div class="flex flex-wrap justify-center">
<a href="https://github.com/done-devs/done/releases/download/v0.2.0/dev.edfloreshz.Done.Devel.flatpak"
<a href="https://github.com/done-devs/done/releases/download/v0.2.1/dev.edfloreshz.Done.Devel.flatpak"
class="warning dark:text-black text-xl font-bold mt-6 p-3 m-2 rounded-md">Install Development Version</a>
</div>
<div class="flex flex-wrap justify-center mt-6">
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('done', 'rust',
version: '0.2.0',
version: '0.2.1',
license: ['MPL-2.0'],
meson_version: '>= 0.59.0',
default_options: [ 'warning_level=2'],
Expand Down
8 changes: 4 additions & 4 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ parts:
plugin: rust
source: .
rust-channel: "1.76"
override-build: ''
override-prime:
override-build: ""
override-prime:

done:
after: [rustup]
plugin: meson
source: https://github.com/done-devs/done.git
source-tag: 'v0.2.0'
source-tag: "v0.2.1"
source-depth: 1
build-environment:
- PATH: ${HOME}/.cargo/bin:$PATH
- PATH: ${HOME}/.cargo/bin:$PATH
meson-parameters:
- --prefix=/snap/done/current/usr
parse-info: [usr/share/metainfo/dev.edfloreshz.Done.metainfo.xml]
Expand Down
15 changes: 7 additions & 8 deletions src/app/components/preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use relm4::{
gtk, AsyncComponentSender,
};

use crate::app::config::appearance::ColorScheme;
use crate::app::config::preferences::Preferences;
use crate::app::config::{appearance::ColorScheme, info::APP_ID};
use crate::fl;

#[derive(Debug)]
Expand Down Expand Up @@ -115,12 +115,11 @@ impl AsyncComponent for PreferencesComponentModel {
root: Self::Root,
sender: AsyncComponentSender<Self>,
) -> AsyncComponentParts<Self> {
let preferences =
if let Ok(config) = Config::new("dev.edfloreshz.done", 1, None) {
config.get_json("preferences").unwrap_or(Preferences::new())
} else {
Preferences::new()
};
let preferences = if let Ok(config) = Config::new(APP_ID, 1, None) {
config.get_json("preferences").unwrap_or(Preferences::new())
} else {
Preferences::new()
};

let model = Self { preferences };

Expand Down Expand Up @@ -187,7 +186,7 @@ impl AsyncComponent for PreferencesComponentModel {
}

fn update_preferences(preferences: &Preferences) -> Result<()> {
Config::new("dev.edfloreshz.done", 1, None)?
Config::new(APP_ID, 1, None)?
.set_json::<Preferences>("preferences", preferences.to_owned())?;
Ok(())
}
4 changes: 2 additions & 2 deletions src/app/config/appearance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use libset::Config;
use relm4::adw;
use serde::{Deserialize, Serialize};

use super::preferences::Preferences;
use super::{info::APP_ID, preferences::Preferences};

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub enum ColorScheme {
Expand All @@ -19,7 +19,7 @@ impl Default for ColorScheme {
}

pub(crate) fn init() -> Result<()> {
let project = Config::new("dev.edfloreshz.done", 1, None).unwrap();
let project = Config::new(APP_ID, 1, None).unwrap();
match project.get_json::<Preferences>("preferences") {
Ok(preferences) => {
let color_scheme = match preferences.color_scheme {
Expand Down
2 changes: 1 addition & 1 deletion src/app/config/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ pub const PROFILE: &str = "";
#[allow(dead_code)]
pub const RESOURCES_FILE: &str =
concat!("/usr/local/share/done", "/resources.gresource");
pub const VERSION: &str = "0.2.0";
pub const VERSION: &str = "0.2.1";
23 changes: 18 additions & 5 deletions src/app/config/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,28 @@ use anyhow::Result;
use core_done::services::local::database::{Database, DATABASE_NAME};
use libset::{Config, FileType};

use super::preferences::Preferences;
use super::{info::APP_ID, preferences::Preferences};

pub(crate) fn init() -> Result<()> {
let config = Config::new("dev.edfloreshz.done", 1, None)?;
let database = Config::new("dev.edfloreshz.done", 1, Some("database"))?;
let config = Config::new(APP_ID, 1, None)?;
let database = Config::new(APP_ID, 1, Some("database"))?;
let database_path = database.path(DATABASE_NAME, FileType::Plain)?;

let previous_database_path = dirs::data_dir()
.unwrap()
.join(APP_ID)
.join("dev.edfloreshz.Done.db");

if previous_database_path.exists() {
let db = std::fs::read(&previous_database_path)?;
std::fs::write(&database_path, db)?;
std::fs::remove_dir_all(previous_database_path.parent().unwrap())?;
}

if !config.path("preferences", FileType::Json)?.exists() {
config.set_json("preferences", Preferences::new())?;
}
if !database.path(DATABASE_NAME, FileType::Plain)?.exists() {
if !database_path.exists() {
database.set_plain(DATABASE_NAME, String::new())?;
}

Expand All @@ -20,6 +33,6 @@ pub(crate) fn init() -> Result<()> {
}

pub(crate) fn refresh() -> Result<()> {
Config::new("dev.edfloreshz.done", 1, None)?.clean()?;
Config::new(APP_ID, 1, None)?.clean()?;
init()
}
4 changes: 2 additions & 2 deletions src/app/factories/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ impl AsyncFactoryComponent for TaskModel {
set_spacing: 6,
gtk::SpinButton {
set_adjustment: &gtk::Adjustment::new(
self.task.reminder_date.unwrap_or_default().time().hour().try_into().unwrap_or(0.0), 0.0, 23.0, 1.0, 1.0, 0.0
self.task.reminder_date.unwrap_or_default().time().hour() as f64, 0.0, 23.0, 1.0, 1.0, 0.0
),
set_orientation: gtk::Orientation::Vertical,
set_wrap: true,
Expand All @@ -349,7 +349,7 @@ impl AsyncFactoryComponent for TaskModel {
},
gtk::SpinButton {
set_adjustment: &gtk::Adjustment::new(
self.task.reminder_date.unwrap_or_default().time().minute().try_into().unwrap_or(0.0), 0.0, 59.0, 1.0, 1.0, 0.0
self.task.reminder_date.unwrap_or_default().time().minute() as f64, 0.0, 59.0, 1.0, 1.0, 0.0
),
set_orientation: gtk::Orientation::Vertical,
set_wrap: true,
Expand Down

0 comments on commit cc0e916

Please sign in to comment.