Skip to content

Commit

Permalink
Merge branch 'release/v0.4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Sep 2, 2021
2 parents 67491ab + 8fd693b commit 7dc630c
Show file tree
Hide file tree
Showing 20 changed files with 512 additions and 48 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@ All notable changes to thoth will be documented in this file.
The format 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).

## [[0.4.6]](https://github.com/thoth-pub/thoth/releases/tag/v0.4.6) - 2021-09-02
### Added
- [#88](https://github.com/thoth-pub/thoth/issues/88) - Implement KBART specification
- [#266](https://github.com/thoth-pub/thoth/issues/266) - Delete confirmation to publications

### Changed
- [#272](https://github.com/thoth-pub/thoth/issues/272) - Use more fields in `contributors` filtering

### Fixed
- [#271](https://github.com/thoth-pub/thoth/issues/271) - Make filter parameter optional in `subjectCount`


## [[0.4.5]](https://github.com/thoth-pub/thoth/releases/tag/v0.4.5) - 2021-08-12
### Added
- [#259](https://github.com/thoth-pub/thoth/issues/259) - Units selection dropdown to Work and NewWork pages, which updates the Width/Height display on change
- [#259](https://github.com/thoth-pub/thoth/issues/259) - Local storage key to retain user's choice of units across all Work/NewWork pages
- [#259](https://github.com/thoth-pub/thoth/issues/259) - Backend function to convert to/from database units (mm): uses 1inch = 25.4mm as conversion factor, rounds mm values to nearest mm, rounds cm values to 1 decimal place, rounds inch values to 2 decimal places and then to nearest sixteenth of an inch
- [#259](https://github.com/thoth-pub/thoth/issues/259) - Backend function to convert to/from database units (mm): uses 1inch = 25.4mm as conversion factor, rounds mm values to nearest mm, rounds cm values to 1 decimal place, rounds inch values to 2 decimal places
- [#259](https://github.com/thoth-pub/thoth/issues/259) - Constraints on Width/Height fields depending on unit selection: user may only enter whole numbers when in mm, numbers with up to 1 decimal place when in cm, numbers with up to 2 decimal places when in inches

### Changed
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

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

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth"
version = "0.4.5"
version = "0.4.6"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand All @@ -16,11 +16,11 @@ maintenance = { status = "actively-developed" }
members = ["thoth-api", "thoth-api-server", "thoth-app", "thoth-app-server", "thoth-client", "thoth-errors", "thoth-export-server"]

[dependencies]
thoth-api = { version = "0.4.5", path = "thoth-api", features = ["backend"] }
thoth-api-server = { version = "0.4.5", path = "thoth-api-server" }
thoth-app-server = { version = "0.4.5", path = "thoth-app-server" }
thoth-errors = { version = "0.4.5", path = "thoth-errors" }
thoth-export-server = { version = "0.4.5", path = "thoth-export-server" }
thoth-api = { version = "0.4.6", path = "thoth-api", features = ["backend"] }
thoth-api-server = { version = "0.4.6", path = "thoth-api-server" }
thoth-app-server = { version = "0.4.6", path = "thoth-app-server" }
thoth-errors = { version = "0.4.6", path = "thoth-errors" }
thoth-export-server = { version = "0.4.6", path = "thoth-export-server" }
clap = "2.33.3"
dialoguer = "0.7.1"
dotenv = "0.9.0"
Expand Down
6 changes: 3 additions & 3 deletions thoth-api-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-api-server"
version = "0.4.5"
version = "0.4.6"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand All @@ -9,8 +9,8 @@ repository = "https://github.com/thoth-pub/thoth"
readme = "README.md"

[dependencies]
thoth-api = { version = "0.4.5", path = "../thoth-api", features = ["backend"] }
thoth-errors = { version = "0.4.5", path = "../thoth-errors" }
thoth-api = { version = "0.4.6", path = "../thoth-api", features = ["backend"] }
thoth-errors = { version = "0.4.6", path = "../thoth-errors" }
actix-web = "3.3.2"
actix-cors = "0.5.4"
actix-identity = "0.3.1"
Expand Down
4 changes: 2 additions & 2 deletions thoth-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-api"
version = "0.4.5"
version = "0.4.6"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand All @@ -16,7 +16,7 @@ maintenance = { status = "actively-developed" }
backend = ["diesel", "diesel-derive-enum", "diesel_migrations", "futures", "actix-web"]

[dependencies]
thoth-errors = { version = "0.4.5", path = "../thoth-errors" }
thoth-errors = { version = "0.4.6", path = "../thoth-errors" }
actix-web = { version = "3.3.2", optional = true }
argon2rs = "0.2.5"
isbn2 = "0.4.0"
Expand Down
2 changes: 2 additions & 0 deletions thoth-api/src/contributor/crud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl Crud for Contributor {
query = query.filter(
full_name
.ilike(format!("%{}%", filter))
.or(last_name.ilike(format!("%{}%", filter)))
.or(orcid.ilike(format!("%{}%", filter))),
);
}
Expand Down Expand Up @@ -104,6 +105,7 @@ impl Crud for Contributor {
query = query.filter(
full_name
.ilike(format!("%{}%", filter))
.or(last_name.ilike(format!("%{}%", filter)))
.or(orcid.ilike(format!("%{}%", filter))),
);
}
Expand Down
15 changes: 12 additions & 3 deletions thoth-api/src/graphql/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ impl QueryRoot {
offset(default = 0, description = "The number of items to skip"),
filter(
default = "".to_string(),
description = "A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_name and orcid"
description = "A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_name, last_name and orcid"
),
order(
default = ContributorOrderBy::default(),
Expand Down Expand Up @@ -455,7 +455,7 @@ impl QueryRoot {
arguments(
filter(
default = "".to_string(),
description = "A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_name and orcid",
description = "A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_name, last_name and orcid",
),
)
)]
Expand Down Expand Up @@ -815,7 +815,16 @@ impl QueryRoot {
Subject::from_id(&context.db, &subject_id).map_err(|e| e.into())
}

#[graphql(description = "Get the total number of subjects associated to works")]
#[graphql(
description = "Get the total number of subjects associated to works",
arguments(
filter(
default = "".to_string(),
description = "A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on subject_code",
),
subject_type(description = "A specific type to filter by"),
)
)]
fn subject_count(
context: &Context,
filter: String,
Expand Down
2 changes: 1 addition & 1 deletion thoth-app-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-app-server"
version = "0.4.5"
version = "0.4.6"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions thoth-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-app"
version = "0.4.5"
version = "0.4.6"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down Expand Up @@ -33,5 +33,5 @@ serde = { version = "1.0.115", features = ["derive"] }
serde_json = "1.0"
url = "2.1.1"
uuid = { version = "0.7", features = ["serde", "v4"] }
thoth-api = { version = "0.4.5", path = "../thoth-api" }
thoth-errors = { version = "0.4.5", path = "../thoth-errors" }
thoth-api = { version = "0.4.6", path = "../thoth-api" }
thoth-errors = { version = "0.4.6", path = "../thoth-errors" }
2 changes: 1 addition & 1 deletion thoth-app/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start_url": "/?homescreen=1",
"background_color": "#ffffff",
"theme_color": "#ffdd57",
"version": "0.4.5",
"version": "0.4.6",
"icons": [
{
"src": "\/android-icon-36x36.png",
Expand Down
14 changes: 10 additions & 4 deletions thoth-app/src/component/publication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::agent::notification_bus::NotificationBus;
use crate::agent::notification_bus::NotificationDispatcher;
use crate::agent::notification_bus::NotificationStatus;
use crate::agent::notification_bus::Request;
use crate::component::delete_dialogue::ConfirmDeleteComponent;
use crate::component::prices_form::PricesFormComponent;
use crate::component::utils::Loader;
use crate::models::publication::delete_publication_mutation::DeletePublicationRequest;
Expand All @@ -32,7 +33,6 @@ use crate::models::publication::publication_query::PublicationRequestBody;
use crate::models::publication::publication_query::Variables;
use crate::route::AdminRoute;
use crate::route::AppRoute;
use crate::string::DELETE_BUTTON;

pub struct PublicationComponent {
publication: PublicationWithRelations,
Expand Down Expand Up @@ -219,9 +219,15 @@ impl Component for PublicationComponent {
</div>
<div class="level-right">
<p class="level-item">
<button class="button is-danger" onclick=self.link.callback(|_| Msg::DeletePublication)>
{ DELETE_BUTTON }
</button>
<ConfirmDeleteComponent
onclick=self.link.callback(|_| Msg::DeletePublication)
object_name=self
.publication.isbn
.as_ref()
.map(|s| s.to_string())
.unwrap_or_else(|| self.publication.publication_id.to_string())
.clone()
/>
</p>
</div>
</nav>
Expand Down
16 changes: 15 additions & 1 deletion thoth-app/src/models/work/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ pub trait DisplayWork {
fn onix_projectmuse_endpoint(&self) -> String;
fn onix_oapen_endpoint(&self) -> String;
fn csv_endpoint(&self) -> String;
fn kbart_endpoint(&self) -> String;
fn cover_alt_text(&self) -> String;
fn license_icons(&self) -> Html;
fn status_tag(&self) -> Html;
Expand Down Expand Up @@ -147,6 +148,13 @@ impl DisplayWork for WorkWithRelations {
)
}

fn kbart_endpoint(&self) -> String {
format!(
"{}/specifications/kbart::oclc/work/{}",
THOTH_EXPORT_API, &self.work_id
)
}

fn cover_alt_text(&self) -> String {
format!("{} - Cover Image", &self.title)
}
Expand Down Expand Up @@ -340,7 +348,7 @@ impl DisplayWork for WorkWithRelations {
href={self.onix_projectmuse_endpoint()}
class="dropdown-item"
>
{"ONIX (Project Muse)"}
{"ONIX (Project MUSE)"}
</a>
<a
href={self.onix_oapen_endpoint()}
Expand All @@ -354,6 +362,12 @@ impl DisplayWork for WorkWithRelations {
>
{"CSV"}
</a>
<a
href={self.kbart_endpoint()}
class="dropdown-item"
>
{"KBART"}
</a>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions thoth-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-client"
version = "0.4.5"
version = "0.4.6"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand All @@ -9,8 +9,8 @@ repository = "https://github.com/thoth-pub/thoth"
readme = "README.md"

[dependencies]
thoth-api = {version = "0.4.5", path = "../thoth-api" }
thoth-errors = {version = "0.4.5", path = "../thoth-errors" }
thoth-api = {version = "0.4.6", path = "../thoth-api" }
thoth-errors = {version = "0.4.6", path = "../thoth-errors" }
graphql_client = "0.9.0"
chrono = { version = "0.4", features = ["serde"] }
reqwest = { version = "0.10", features = ["json"] }
Expand Down
2 changes: 1 addition & 1 deletion thoth-errors/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-errors"
version = "0.4.5"
version = "0.4.6"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
8 changes: 4 additions & 4 deletions thoth-export-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-export-server"
version = "0.4.5"
version = "0.4.6"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand All @@ -9,9 +9,9 @@ repository = "https://github.com/thoth-pub/thoth"
readme = "README.md"

[dependencies]
thoth-api = { version = "0.4.5", path = "../thoth-api" }
thoth-errors = { version = "0.4.5", path = "../thoth-errors" }
thoth-client = { version = "0.4.5", path = "../thoth-client" }
thoth-api = { version = "0.4.6", path = "../thoth-api" }
thoth-errors = { version = "0.4.6", path = "../thoth-errors" }
thoth-client = { version = "0.4.6", path = "../thoth-client" }
actix-web = "3.3.2"
actix-cors = "0.5.4"
chrono = { version = "0.4", features = ["serde"] }
Expand Down
4 changes: 3 additions & 1 deletion thoth-export-server/src/csv/csv_thoth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ impl CsvCell<CsvThoth> for WorkFundings {
#[cfg(test)]
mod tests {
use super::*;
use crate::record::DELIMITER_COMMA;
use csv::QuoteStyle;
use lazy_static::lazy_static;
use std::str::FromStr;
use thoth_client::{
Expand Down Expand Up @@ -495,7 +497,7 @@ mod tests {

#[test]
fn test_csv_thoth() {
let to_test = CsvThoth.generate(&[TEST_WORK.clone()]);
let to_test = CsvThoth.generate(&[TEST_WORK.clone()], QuoteStyle::Always, DELIMITER_COMMA);

assert_eq!(to_test, Ok(TEST_RESULT.to_string()))
}
Expand Down
Loading

0 comments on commit 7dc630c

Please sign in to comment.