Skip to content

Commit 73336cf

Browse files
committed
Merge branch 'release/v0.2.7'
2 parents 0e34566 + 8bfb62e commit 73336cf

20 files changed

+575
-218
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.7]](https://github.com/thoth-pub/thoth/releases/tag/v0.2.7) - 2020-11-19
8+
### Changed
9+
- [#118](https://github.com/thoth-pub/thoth/issues/118) - Ensure empty data is sent as null not as empty strings
10+
- [#131](https://github.com/thoth-pub/thoth/issues/131) - Moved forms with relationships outside main object form
11+
712
## [[0.2.6]](https://github.com/thoth-pub/thoth/releases/tag/v0.2.6) - 2020-11-13
813
### Changed
914
- Fix pricing functionality ommitted in previous release

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.6"
3+
version = "0.2.7"
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.6", path = "thoth-api", features = ["backend"] }
20-
thoth-client = {version = "0.2.6", path = "thoth-client" }
19+
thoth-api = {version = "0.2.7", path = "thoth-api", features = ["backend"] }
20+
thoth-client = {version = "0.2.7", 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.6"
3+
version = "0.2.7"
44
authors = ["Javier Arias <javi@openbookpublishers.com>"]
55
edition = "2018"
66
license = "Apache-2.0"

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.6"
3+
version = "0.2.7"
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.6", path = "../thoth-api" }
33+
thoth-api = { version = "0.2.7", path = "../thoth-api" }

thoth-app/src/component/contributor.rs

+28-6
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,35 @@ impl Component for ContributorComponent {
227227
.send_message(Msg::SetContributorDeleteState(FetchAction::Fetching));
228228
false
229229
}
230-
Msg::ChangeFirstName(first_name) => {
231-
self.contributor.first_name.neq_assign(Some(first_name))
230+
Msg::ChangeFirstName(value) => {
231+
let first_name = match value.trim().is_empty() {
232+
true => None,
233+
false => Some(value.trim().to_owned()),
234+
};
235+
self.contributor.first_name.neq_assign(first_name)
236+
}
237+
Msg::ChangeLastName(last_name) => self
238+
.contributor
239+
.last_name
240+
.neq_assign(last_name.trim().to_owned()),
241+
Msg::ChangeFullName(full_name) => self
242+
.contributor
243+
.full_name
244+
.neq_assign(full_name.trim().to_owned()),
245+
Msg::ChangeOrcid(value) => {
246+
let orcid = match value.trim().is_empty() {
247+
true => None,
248+
false => Some(value.trim().to_owned()),
249+
};
250+
self.contributor.orcid.neq_assign(orcid)
251+
}
252+
Msg::ChangeWebsite(value) => {
253+
let website = match value.trim().is_empty() {
254+
true => None,
255+
false => Some(value.trim().to_owned()),
256+
};
257+
self.contributor.website.neq_assign(website)
232258
}
233-
Msg::ChangeLastName(last_name) => self.contributor.last_name.neq_assign(last_name),
234-
Msg::ChangeFullName(full_name) => self.contributor.full_name.neq_assign(full_name),
235-
Msg::ChangeOrcid(orcid) => self.contributor.orcid.neq_assign(Some(orcid)),
236-
Msg::ChangeWebsite(website) => self.contributor.website.neq_assign(Some(website)),
237259
Msg::ChangeRoute(r) => {
238260
let route = Route::from(r);
239261
self.router.send(RouteRequest::ChangeRoute(route));

thoth-app/src/component/funder.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,17 @@ impl Component for FunderComponent {
219219
.send_message(Msg::SetFunderDeleteState(FetchAction::Fetching));
220220
false
221221
}
222-
Msg::ChangeFunderName(funder_name) => self.funder.funder_name.neq_assign(funder_name),
223-
Msg::ChangeFunderDoi(funder_doi) => self.funder.funder_doi.neq_assign(Some(funder_doi)),
222+
Msg::ChangeFunderName(funder_name) => self
223+
.funder
224+
.funder_name
225+
.neq_assign(funder_name.trim().to_owned()),
226+
Msg::ChangeFunderDoi(value) => {
227+
let funder_doi = match value.trim().is_empty() {
228+
true => None,
229+
false => Some(value.trim().to_owned()),
230+
};
231+
self.funder.funder_doi.neq_assign(funder_doi)
232+
}
224233
Msg::ChangeRoute(r) => {
225234
let route = Route::from(r);
226235
self.router.send(RouteRequest::ChangeRoute(route));

thoth-app/src/component/imprint.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,16 @@ impl Component for ImprintComponent {
270270
false
271271
}
272272
}
273-
Msg::ChangeImprintName(imprint_name) => {
274-
self.imprint.imprint_name.neq_assign(imprint_name)
275-
}
276-
Msg::ChangeImprintUrl(imprint_url) => {
277-
self.imprint.imprint_url.neq_assign(Some(imprint_url))
273+
Msg::ChangeImprintName(imprint_name) => self
274+
.imprint
275+
.imprint_name
276+
.neq_assign(imprint_name.trim().to_owned()),
277+
Msg::ChangeImprintUrl(value) => {
278+
let imprint_url = match value.trim().is_empty() {
279+
true => None,
280+
false => Some(value.trim().to_owned()),
281+
};
282+
self.imprint.imprint_url.neq_assign(imprint_url)
278283
}
279284
Msg::ChangeRoute(r) => {
280285
let route = Route::from(r);

thoth-app/src/component/new_contributor.rs

+28-6
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,35 @@ impl Component for NewContributorComponent {
118118
.send_message(Msg::SetContributorPushState(FetchAction::Fetching));
119119
false
120120
}
121-
Msg::ChangeFirstName(first_name) => {
122-
self.contributor.first_name.neq_assign(Some(first_name))
121+
Msg::ChangeFirstName(value) => {
122+
let first_name = match value.trim().is_empty() {
123+
true => None,
124+
false => Some(value.trim().to_owned()),
125+
};
126+
self.contributor.first_name.neq_assign(first_name)
127+
}
128+
Msg::ChangeLastName(last_name) => self
129+
.contributor
130+
.last_name
131+
.neq_assign(last_name.trim().to_owned()),
132+
Msg::ChangeFullName(full_name) => self
133+
.contributor
134+
.full_name
135+
.neq_assign(full_name.trim().to_owned()),
136+
Msg::ChangeOrcid(value) => {
137+
let orcid = match value.trim().is_empty() {
138+
true => None,
139+
false => Some(value.trim().to_owned()),
140+
};
141+
self.contributor.orcid.neq_assign(orcid)
142+
}
143+
Msg::ChangeWebsite(value) => {
144+
let website = match value.trim().is_empty() {
145+
true => None,
146+
false => Some(value.trim().to_owned()),
147+
};
148+
self.contributor.website.neq_assign(website)
123149
}
124-
Msg::ChangeLastName(last_name) => self.contributor.last_name.neq_assign(last_name),
125-
Msg::ChangeFullName(full_name) => self.contributor.full_name.neq_assign(full_name),
126-
Msg::ChangeOrcid(orcid) => self.contributor.orcid.neq_assign(Some(orcid)),
127-
Msg::ChangeWebsite(website) => self.contributor.website.neq_assign(Some(website)),
128150
Msg::ChangeRoute(r) => {
129151
let route = Route::from(r);
130152
self.router.send(RouteRequest::ChangeRoute(route));

thoth-app/src/component/new_funder.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,17 @@ impl Component for NewFunderComponent {
112112
.send_message(Msg::SetFunderPushState(FetchAction::Fetching));
113113
false
114114
}
115-
Msg::ChangeFunderName(funder_name) => self.funder.funder_name.neq_assign(funder_name),
116-
Msg::ChangeFunderDoi(funder_doi) => self.funder.funder_doi.neq_assign(Some(funder_doi)),
115+
Msg::ChangeFunderName(funder_name) => self
116+
.funder
117+
.funder_name
118+
.neq_assign(funder_name.trim().to_owned()),
119+
Msg::ChangeFunderDoi(value) => {
120+
let funder_doi = match value.trim().is_empty() {
121+
true => None,
122+
false => Some(value.trim().to_owned()),
123+
};
124+
self.funder.funder_doi.neq_assign(funder_doi)
125+
}
117126
Msg::ChangeRoute(r) => {
118127
let route = Route::from(r);
119128
self.router.send(RouteRequest::ChangeRoute(route));

thoth-app/src/component/new_imprint.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,16 @@ impl Component for NewImprintComponent {
154154
false
155155
}
156156
Msg::ChangePublisher(publisher_id) => self.publisher_id.neq_assign(publisher_id),
157-
Msg::ChangeImprintName(imprint_name) => {
158-
self.imprint.imprint_name.neq_assign(imprint_name)
159-
}
160-
Msg::ChangeImprintUrl(imprint_url) => {
161-
self.imprint.imprint_url.neq_assign(Some(imprint_url))
157+
Msg::ChangeImprintName(imprint_name) => self
158+
.imprint
159+
.imprint_name
160+
.neq_assign(imprint_name.trim().to_owned()),
161+
Msg::ChangeImprintUrl(value) => {
162+
let imprint_url = match value.trim().is_empty() {
163+
true => None,
164+
false => Some(value.trim().to_owned()),
165+
};
166+
self.imprint.imprint_url.neq_assign(imprint_url)
162167
}
163168
Msg::ChangeRoute(r) => {
164169
let route = Route::from(r);

thoth-app/src/component/new_publisher.rs

+18-8
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,25 @@ impl Component for NewPublisherComponent {
114114
.send_message(Msg::SetPublisherPushState(FetchAction::Fetching));
115115
false
116116
}
117-
Msg::ChangePublisherName(publisher_name) => {
118-
self.publisher.publisher_name.neq_assign(publisher_name)
119-
}
120-
Msg::ChangePublisherShortname(publisher_shortname) => self
117+
Msg::ChangePublisherName(publisher_name) => self
121118
.publisher
122-
.publisher_shortname
123-
.neq_assign(Some(publisher_shortname)),
124-
Msg::ChangePublisherUrl(publisher_url) => {
125-
self.publisher.publisher_url.neq_assign(Some(publisher_url))
119+
.publisher_name
120+
.neq_assign(publisher_name.trim().to_owned()),
121+
Msg::ChangePublisherShortname(value) => {
122+
let publisher_shortname = match value.trim().is_empty() {
123+
true => None,
124+
false => Some(value.trim().to_owned()),
125+
};
126+
self.publisher
127+
.publisher_shortname
128+
.neq_assign(publisher_shortname)
129+
}
130+
Msg::ChangePublisherUrl(value) => {
131+
let publisher_url = match value.trim().is_empty() {
132+
true => None,
133+
false => Some(value.trim().to_owned()),
134+
};
135+
self.publisher.publisher_url.neq_assign(publisher_url)
126136
}
127137
Msg::ChangeRoute(r) => {
128138
let route = Route::from(r);

thoth-app/src/component/new_series.rs

+18-5
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,25 @@ impl Component for NewSeriesComponent {
188188
}
189189
Msg::ChangeSeriesType(series_type) => self.series.series_type.neq_assign(series_type),
190190
Msg::ChangeImprint(imprint_id) => self.series.imprint.imprint_id.neq_assign(imprint_id),
191-
Msg::ChangeSeriesName(series_name) => self.series.series_name.neq_assign(series_name),
192-
Msg::ChangeIssnPrint(issn_print) => self.series.issn_print.neq_assign(issn_print),
193-
Msg::ChangeIssnDigital(issn_digital) => {
194-
self.series.issn_digital.neq_assign(issn_digital)
191+
Msg::ChangeSeriesName(series_name) => self
192+
.series
193+
.series_name
194+
.neq_assign(series_name.trim().to_owned()),
195+
Msg::ChangeIssnPrint(issn_print) => self
196+
.series
197+
.issn_print
198+
.neq_assign(issn_print.trim().to_owned()),
199+
Msg::ChangeIssnDigital(issn_digital) => self
200+
.series
201+
.issn_digital
202+
.neq_assign(issn_digital.trim().to_owned()),
203+
Msg::ChangeSeriesUrl(value) => {
204+
let series_url = match value.trim().is_empty() {
205+
true => None,
206+
false => Some(value.trim().to_owned()),
207+
};
208+
self.series.series_url.neq_assign(series_url)
195209
}
196-
Msg::ChangeSeriesUrl(series_url) => self.series.series_url.neq_assign(Some(series_url)),
197210
Msg::ChangeRoute(r) => {
198211
let route = Route::from(r);
199212
self.router.send(RouteRequest::ChangeRoute(route));

0 commit comments

Comments
 (0)