Skip to content

Commit dd965d8

Browse files
committed
Merge branch 'release/v0.10.0'
2 parents e3f7d6c + 7e78725 commit dd965d8

46 files changed

Lines changed: 1918 additions & 103 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [[0.10.0]](https://github.com/thoth-pub/thoth/releases/tag/v0.10.0) - 2023-04-03
10+
### Added
11+
- [42](https://github.com/thoth-pub/thoth/pull/42) - Generate MARC 21 records
12+
- New `work` field `bibliography_note`
13+
914
## [[0.9.18]](https://github.com/thoth-pub/thoth/releases/tag/v0.9.18) - 2023-03-27
1015
### Security
1116
- Upgrade `r2d2` to v0.8.10

Cargo.lock

Lines changed: 26 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth"
3-
version = "0.9.18"
3+
version = "0.10.0"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2018"
66
license = "Apache-2.0"
@@ -16,11 +16,11 @@ maintenance = { status = "actively-developed" }
1616
members = ["thoth-api", "thoth-api-server", "thoth-app", "thoth-app-server", "thoth-client", "thoth-errors", "thoth-export-server"]
1717

1818
[dependencies]
19-
thoth-api = { version = "0.9.18", path = "thoth-api", features = ["backend"] }
20-
thoth-api-server = { version = "0.9.18", path = "thoth-api-server" }
21-
thoth-app-server = { version = "0.9.18", path = "thoth-app-server" }
22-
thoth-errors = { version = "0.9.18", path = "thoth-errors" }
23-
thoth-export-server = { version = "0.9.18", path = "thoth-export-server" }
19+
thoth-api = { version = "0.10.0", path = "thoth-api", features = ["backend"] }
20+
thoth-api-server = { version = "0.10.0", path = "thoth-api-server" }
21+
thoth-app-server = { version = "0.10.0", path = "thoth-app-server" }
22+
thoth-errors = { version = "0.10.0", path = "thoth-errors" }
23+
thoth-export-server = { version = "0.10.0", path = "thoth-export-server" }
2424
clap = "2.33.3"
2525
dialoguer = "0.7.1"
2626
dotenv = "0.15.0"

thoth-api-server/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api-server"
3-
version = "0.9.18"
3+
version = "0.10.0"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2018"
66
license = "Apache-2.0"
@@ -9,8 +9,8 @@ repository = "https://github.com/thoth-pub/thoth"
99
readme = "README.md"
1010

1111
[dependencies]
12-
thoth-api = { version = "0.9.18", path = "../thoth-api", features = ["backend"] }
13-
thoth-errors = { version = "0.9.18", path = "../thoth-errors" }
12+
thoth-api = { version = "0.10.0", path = "../thoth-api", features = ["backend"] }
13+
thoth-errors = { version = "0.10.0", path = "../thoth-errors" }
1414
actix-web = "4.3.0"
1515
actix-cors = "0.6.4"
1616
actix-identity = "0.4.0"

thoth-api/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api"
3-
version = "0.9.18"
3+
version = "0.10.0"
44
authors = ["Javier Arias <javi@openbookpublishers.com>", "Ross Higman <ross@openbookpublishers.com>"]
55
edition = "2018"
66
license = "Apache-2.0"
@@ -16,7 +16,7 @@ maintenance = { status = "actively-developed" }
1616
backend = ["diesel", "diesel-derive-enum", "diesel_migrations", "futures", "actix-web"]
1717

1818
[dependencies]
19-
thoth-errors = { version = "0.9.18", path = "../thoth-errors" }
19+
thoth-errors = { version = "0.10.0", path = "../thoth-errors" }
2020
actix-web = { version = "4.3.0", optional = true }
2121
argon2rs = "0.2.5"
2222
isbn2 = "0.4.0"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE work
2+
DROP COLUMN IF EXISTS bibliography_note;

thoth-api/migrations/0.10.0/up.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE work
2+
ADD COLUMN IF NOT EXISTS bibliography_note TEXT CHECK (octet_length(bibliography_note) >= 1);

thoth-api/src/graphql/model.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2341,10 +2341,20 @@ impl Work {
23412341
self.long_abstract.as_ref()
23422342
}
23432343

2344+
#[graphql(
2345+
description = "A general-purpose field used to include information that does not have a specific designated field"
2346+
)]
23442347
pub fn general_note(&self) -> Option<&String> {
23452348
self.general_note.as_ref()
23462349
}
23472350

2351+
#[graphql(
2352+
description = "Indicates that the work contains a bibliogrpahy or other similar information"
2353+
)]
2354+
pub fn bibliography_note(&self) -> Option<&String> {
2355+
self.bibliography_note.as_ref()
2356+
}
2357+
23482358
#[graphql(description = "Table of contents of the work (not applicable to chapters)")]
23492359
pub fn toc(&self) -> Option<&String> {
23502360
self.toc.as_ref()

thoth-api/src/model/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ impl Doi {
255255
}
256256
}
257257

258+
impl Isbn {
259+
pub fn to_hyphenless_string(&self) -> String {
260+
self.0.replace('-', "")
261+
}
262+
}
263+
258264
#[cfg(feature = "backend")]
259265
#[allow(clippy::too_many_arguments)]
260266
/// Common functionality to perform basic CRUD actions on Thoth entities
@@ -811,6 +817,12 @@ fn test_ror_fromstr() {
811817
assert!(Ror::from_str("0abcdef12https://ror.org/").is_err());
812818
}
813819

820+
#[test]
821+
fn test_isbn_to_hyphenless_string() {
822+
let hyphenless_isbn = Isbn("978-3-16-148410-0".to_string()).to_hyphenless_string();
823+
assert_eq!(hyphenless_isbn, "9783161484100");
824+
}
825+
814826
#[test]
815827
// Float equality comparison is fine here because the floats
816828
// have already been rounded by the functions under test

thoth-api/src/model/work/crud.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ impl Crud for Work {
248248
Direction::Asc => query.order(dsl::general_note.asc()),
249249
Direction::Desc => query.order(dsl::general_note.desc()),
250250
},
251+
WorkField::BibliographyNote => match order.direction {
252+
Direction::Asc => query.order(dsl::bibliography_note.asc()),
253+
Direction::Desc => query.order(dsl::bibliography_note.desc()),
254+
},
251255
WorkField::Toc => match order.direction {
252256
Direction::Asc => query.order(dsl::toc.asc()),
253257
Direction::Desc => query.order(dsl::toc.desc()),

0 commit comments

Comments
 (0)