Skip to content

Commit 5d8de74

Browse files
committed
Merge branch 'release/v0.2.3'
2 parents adf8f74 + 6604f6e commit 5d8de74

38 files changed

+990
-1244
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to thoth will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [[0.2.3]](https://github.com/thoth-pub/thoth/releases/tag/v0.2.3) - 2020-11-06
8+
### Added
9+
- Implemented pagination in all admin components
10+
- Implemented pagination in catalogue
11+
712
## [[0.2.2]](https://github.com/thoth-pub/thoth/releases/tag/v0.2.2) - 2020-11-03
813
### Changed
914
- Set `THOTH_API` on build via docker

Cargo.lock

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
authors = ["Javier Arias <javi@openbookpublishers.com>"]
55
edition = "2018"
66
license = "Apache-2.0"
@@ -16,8 +16,8 @@ maintenance = { status = "actively-developed" }
1616
members = ["thoth-api", "thoth-app", "thoth-client"]
1717

1818
[dependencies]
19-
thoth-api = {version = "0.2.2", path = "thoth-api", features = ["backend"] }
20-
thoth-client = {version = "0.2.2", path = "thoth-client" }
19+
thoth-api = {version = "0.2.3", path = "thoth-api", features = ["backend"] }
20+
thoth-client = {version = "0.2.3", path = "thoth-client" }
2121
actix-http = "1.0.1"
2222
actix-rt = "1.0.0"
2323
actix-web = "3.0.0"

thoth-api/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-api"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
authors = ["Javier Arias <javi@openbookpublishers.com>"]
55
edition = "2018"
66
license = "Apache-2.0"

thoth-api/migrations/0.1.0/up.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ CREATE TABLE work (
7171
license TEXT CHECK (license ~* '^[^:]*:\/\/(?:[^\/:]*:[^\/@]*@)?(?:[^\/:.]*\.)+([^:\/]+)'),
7272
copyright_holder TEXT NOT NULL CHECK (octet_length(copyright_holder) >= 1),
7373
landing_page TEXT CHECK (landing_page ~* '^[^:]*:\/\/(?:[^\/:]*:[^\/@]*@)?(?:[^\/:.]*\.)+([^:\/]+)'),
74-
lccn INTEGER CHECK(lccn > 0),
75-
oclc INTEGER CHECK (oclc > 0),
74+
lccn TEXT CHECK (octet_length(lccn) >= 1),
75+
oclc TEXT CHECK (octet_length(oclc) >= 1),
7676
short_abstract TEXT CHECK (octet_length(short_abstract) >= 1),
7777
long_abstract TEXT CHECK (octet_length(long_abstract) >= 1),
7878
general_note TEXT CHECK (octet_length(general_note) >= 1),

thoth-api/src/graphql/model.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,19 @@ impl QueryRoot {
253253
description = "Query the full list of imprints",
254254
arguments(
255255
limit(default = 100, description = "The number of items to return"),
256-
offset(default = 0, description = "The number of items to skip")
256+
offset(default = 0, description = "The number of items to skip"),
257+
filter(
258+
default = "".to_string(),
259+
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 imprint_name and imprint_url"
260+
),
257261
)
258262
)]
259-
fn imprints(context: &Context, limit: i32, offset: i32) -> Vec<Imprint> {
263+
fn imprints(context: &Context, limit: i32, offset: i32, filter: String) -> Vec<Imprint> {
260264
use crate::schema::imprint::dsl::*;
261265
let connection = context.db.get().unwrap();
262266
imprint
267+
.filter(imprint_name.ilike(format!("%{}%", filter)))
268+
.or_filter(imprint_url.ilike(format!("%{}%", filter)))
263269
.order(imprint_name.asc())
264270
.limit(limit.into())
265271
.offset(offset.into())
@@ -1375,11 +1381,11 @@ impl Work {
13751381
self.landing_page.as_ref()
13761382
}
13771383

1378-
pub fn lccn(&self) -> Option<&i32> {
1384+
pub fn lccn(&self) -> Option<&String> {
13791385
self.lccn.as_ref()
13801386
}
13811387

1382-
pub fn oclc(&self) -> Option<&i32> {
1388+
pub fn oclc(&self) -> Option<&String> {
13831389
self.oclc.as_ref()
13841390
}
13851391

thoth-api/src/schema.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ table! {
196196
license -> Nullable<Text>,
197197
copyright_holder -> Text,
198198
landing_page -> Nullable<Text>,
199-
lccn -> Nullable<Int4>,
200-
oclc -> Nullable<Int4>,
199+
lccn -> Nullable<Text>,
200+
oclc -> Nullable<Text>,
201201
short_abstract -> Nullable<Text>,
202202
long_abstract -> Nullable<Text>,
203203
general_note -> Nullable<Text>,

thoth-api/src/work/model.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ pub struct Work {
7575
pub license: Option<String>,
7676
pub copyright_holder: String,
7777
pub landing_page: Option<String>,
78-
pub lccn: Option<i32>,
79-
pub oclc: Option<i32>,
78+
pub lccn: Option<String>,
79+
pub oclc: Option<String>,
8080
pub short_abstract: Option<String>,
8181
pub long_abstract: Option<String>,
8282
pub general_note: Option<String>,
@@ -113,8 +113,8 @@ pub struct NewWork {
113113
pub license: Option<String>,
114114
pub copyright_holder: String,
115115
pub landing_page: Option<String>,
116-
pub lccn: Option<i32>,
117-
pub oclc: Option<i32>,
116+
pub lccn: Option<String>,
117+
pub oclc: Option<String>,
118118
pub short_abstract: Option<String>,
119119
pub long_abstract: Option<String>,
120120
pub general_note: Option<String>,
@@ -153,8 +153,8 @@ pub struct PatchWork {
153153
pub license: Option<String>,
154154
pub copyright_holder: String,
155155
pub landing_page: Option<String>,
156-
pub lccn: Option<i32>,
157-
pub oclc: Option<i32>,
156+
pub lccn: Option<String>,
157+
pub oclc: Option<String>,
158158
pub short_abstract: Option<String>,
159159
pub long_abstract: Option<String>,
160160
pub general_note: Option<String>,

thoth-app/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thoth-app"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
authors = ["Javier Arias <javi@openbookpublishers.com>"]
55
edition = "2018"
66
license = "Apache-2.0"
@@ -30,4 +30,4 @@ wasm-logger = "0.2.0"
3030
stdweb = "0.4.20"
3131
serde = { version = "1.0.115", features = ["derive"] }
3232
url = "2.1.1"
33-
thoth-api = { version = "0.2.2", path = "../thoth-api" }
33+
thoth-api = { version = "0.2.3", path = "../thoth-api" }

0 commit comments

Comments
 (0)