Skip to content

Commit

Permalink
Merge branch 'release/v0.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Nov 6, 2020
2 parents adf8f74 + 6604f6e commit 5d8de74
Show file tree
Hide file tree
Showing 38 changed files with 990 additions and 1,244 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ 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.2.3]](https://github.com/thoth-pub/thoth/releases/tag/v0.2.3) - 2020-11-06
### Added
- Implemented pagination in all admin components
- Implemented pagination in catalogue

## [[0.2.2]](https://github.com/thoth-pub/thoth/releases/tag/v0.2.2) - 2020-11-03
### Changed
- Set `THOTH_API` on build via docker
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.

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

[dependencies]
thoth-api = {version = "0.2.2", path = "thoth-api", features = ["backend"] }
thoth-client = {version = "0.2.2", path = "thoth-client" }
thoth-api = {version = "0.2.3", path = "thoth-api", features = ["backend"] }
thoth-client = {version = "0.2.3", path = "thoth-client" }
actix-http = "1.0.1"
actix-rt = "1.0.0"
actix-web = "3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion thoth-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-api"
version = "0.2.2"
version = "0.2.3"
authors = ["Javier Arias <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions thoth-api/migrations/0.1.0/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ CREATE TABLE work (
license TEXT CHECK (license ~* '^[^:]*:\/\/(?:[^\/:]*:[^\/@]*@)?(?:[^\/:.]*\.)+([^:\/]+)'),
copyright_holder TEXT NOT NULL CHECK (octet_length(copyright_holder) >= 1),
landing_page TEXT CHECK (landing_page ~* '^[^:]*:\/\/(?:[^\/:]*:[^\/@]*@)?(?:[^\/:.]*\.)+([^:\/]+)'),
lccn INTEGER CHECK(lccn > 0),
oclc INTEGER CHECK (oclc > 0),
lccn TEXT CHECK (octet_length(lccn) >= 1),
oclc TEXT CHECK (octet_length(oclc) >= 1),
short_abstract TEXT CHECK (octet_length(short_abstract) >= 1),
long_abstract TEXT CHECK (octet_length(long_abstract) >= 1),
general_note TEXT CHECK (octet_length(general_note) >= 1),
Expand Down
14 changes: 10 additions & 4 deletions thoth-api/src/graphql/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,19 @@ impl QueryRoot {
description = "Query the full list of imprints",
arguments(
limit(default = 100, description = "The number of items to return"),
offset(default = 0, description = "The number of items to skip")
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 imprint_name and imprint_url"
),
)
)]
fn imprints(context: &Context, limit: i32, offset: i32) -> Vec<Imprint> {
fn imprints(context: &Context, limit: i32, offset: i32, filter: String) -> Vec<Imprint> {
use crate::schema::imprint::dsl::*;
let connection = context.db.get().unwrap();
imprint
.filter(imprint_name.ilike(format!("%{}%", filter)))
.or_filter(imprint_url.ilike(format!("%{}%", filter)))
.order(imprint_name.asc())
.limit(limit.into())
.offset(offset.into())
Expand Down Expand Up @@ -1375,11 +1381,11 @@ impl Work {
self.landing_page.as_ref()
}

pub fn lccn(&self) -> Option<&i32> {
pub fn lccn(&self) -> Option<&String> {
self.lccn.as_ref()
}

pub fn oclc(&self) -> Option<&i32> {
pub fn oclc(&self) -> Option<&String> {
self.oclc.as_ref()
}

Expand Down
4 changes: 2 additions & 2 deletions thoth-api/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ table! {
license -> Nullable<Text>,
copyright_holder -> Text,
landing_page -> Nullable<Text>,
lccn -> Nullable<Int4>,
oclc -> Nullable<Int4>,
lccn -> Nullable<Text>,
oclc -> Nullable<Text>,
short_abstract -> Nullable<Text>,
long_abstract -> Nullable<Text>,
general_note -> Nullable<Text>,
Expand Down
12 changes: 6 additions & 6 deletions thoth-api/src/work/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ pub struct Work {
pub license: Option<String>,
pub copyright_holder: String,
pub landing_page: Option<String>,
pub lccn: Option<i32>,
pub oclc: Option<i32>,
pub lccn: Option<String>,
pub oclc: Option<String>,
pub short_abstract: Option<String>,
pub long_abstract: Option<String>,
pub general_note: Option<String>,
Expand Down Expand Up @@ -113,8 +113,8 @@ pub struct NewWork {
pub license: Option<String>,
pub copyright_holder: String,
pub landing_page: Option<String>,
pub lccn: Option<i32>,
pub oclc: Option<i32>,
pub lccn: Option<String>,
pub oclc: Option<String>,
pub short_abstract: Option<String>,
pub long_abstract: Option<String>,
pub general_note: Option<String>,
Expand Down Expand Up @@ -153,8 +153,8 @@ pub struct PatchWork {
pub license: Option<String>,
pub copyright_holder: String,
pub landing_page: Option<String>,
pub lccn: Option<i32>,
pub oclc: Option<i32>,
pub lccn: Option<String>,
pub oclc: Option<String>,
pub short_abstract: Option<String>,
pub long_abstract: Option<String>,
pub general_note: Option<String>,
Expand Down
4 changes: 2 additions & 2 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.2.2"
version = "0.2.3"
authors = ["Javier Arias <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down Expand Up @@ -30,4 +30,4 @@ wasm-logger = "0.2.0"
stdweb = "0.4.20"
serde = { version = "1.0.115", features = ["derive"] }
url = "2.1.1"
thoth-api = { version = "0.2.2", path = "../thoth-api" }
thoth-api = { version = "0.2.3", path = "../thoth-api" }
Loading

0 comments on commit 5d8de74

Please sign in to comment.