Skip to content

Commit

Permalink
Merge branch 'develop' into feature/426_update_ebsco_host_price
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 authored Sep 20, 2022
2 parents 2e79eb8 + c5f6249 commit 141ca6a
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 19 deletions.
1 change: 1 addition & 0 deletions thoth-api/migrations/0.8.9/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TYPE contribution_type RENAME VALUE 'illustrator' TO 'ilustrator';
1 change: 1 addition & 0 deletions thoth-api/migrations/0.8.9/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TYPE contribution_type RENAME VALUE 'ilustrator' TO 'illustrator';
8 changes: 4 additions & 4 deletions thoth-api/src/model/contribution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub enum ContributionType {
Editor,
Translator,
Photographer,
Ilustrator,
Illustrator,
#[cfg_attr(feature = "backend", db_rename = "music-editor")]
MusicEditor,
#[cfg_attr(feature = "backend", db_rename = "foreword-by")]
Expand Down Expand Up @@ -180,7 +180,7 @@ fn test_contributiontype_display() {
format!("{}", ContributionType::Photographer),
"Photographer"
);
assert_eq!(format!("{}", ContributionType::Ilustrator), "Ilustrator");
assert_eq!(format!("{}", ContributionType::Illustrator), "Illustrator");
assert_eq!(format!("{}", ContributionType::MusicEditor), "Music Editor");
assert_eq!(format!("{}", ContributionType::ForewordBy), "Foreword By");
assert_eq!(
Expand Down Expand Up @@ -211,8 +211,8 @@ fn test_contributiontype_fromstr() {
ContributionType::Photographer
);
assert_eq!(
ContributionType::from_str("Ilustrator").unwrap(),
ContributionType::Ilustrator
ContributionType::from_str("Illustrator").unwrap(),
ContributionType::Illustrator
);
assert_eq!(
ContributionType::from_str("Music Editor").unwrap(),
Expand Down
4 changes: 2 additions & 2 deletions thoth-client/assets/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7736,7 +7736,7 @@
"deprecationReason": null,
"description": null,
"isDeprecated": false,
"name": "ILUSTRATOR"
"name": "ILLUSTRATOR"
},
{
"deprecationReason": null,
Expand Down Expand Up @@ -20732,4 +20732,4 @@
]
}
}
}
}
2 changes: 1 addition & 1 deletion thoth-export-server/src/xml/doideposit_crossref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ impl XmlElementBlock<DoiDepositCrossref> for WorkRelationsRelatedWorkContributio
ContributionType::TRANSLATOR => "translator",
// Only the above roles are supported by this format.
ContributionType::PHOTOGRAPHER
| ContributionType::ILUSTRATOR
| ContributionType::ILLUSTRATOR
| ContributionType::MUSIC_EDITOR
| ContributionType::FOREWORD_BY
| ContributionType::INTRODUCTION_BY
Expand Down
4 changes: 2 additions & 2 deletions thoth-export-server/src/xml/onix21_ebsco_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ impl XmlElement<Onix21EbscoHost> for ContributionType {
ContributionType::EDITOR => "B01",
ContributionType::TRANSLATOR => "B06",
ContributionType::PHOTOGRAPHER => "A13",
ContributionType::ILUSTRATOR => "A12",
ContributionType::ILLUSTRATOR => "A12",
ContributionType::MUSIC_EDITOR => "B25",
ContributionType::FOREWORD_BY => "A23",
ContributionType::INTRODUCTION_BY => "A24",
Expand Down Expand Up @@ -709,7 +709,7 @@ mod tests {
test_contribution.contribution_type = ContributionType::PHOTOGRAPHER;
let output = generate_test_output(true, &test_contribution);
assert!(output.contains(r#" <ContributorRole>A13</ContributorRole>"#));
test_contribution.contribution_type = ContributionType::ILUSTRATOR;
test_contribution.contribution_type = ContributionType::ILLUSTRATOR;
let output = generate_test_output(true, &test_contribution);
assert!(output.contains(r#" <ContributorRole>A12</ContributorRole>"#));
test_contribution.contribution_type = ContributionType::MUSIC_EDITOR;
Expand Down
4 changes: 2 additions & 2 deletions thoth-export-server/src/xml/onix3_google_books.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ impl XmlElement<Onix3GoogleBooks> for ContributionType {
ContributionType::EDITOR => "B01",
ContributionType::TRANSLATOR => "B06",
ContributionType::PHOTOGRAPHER => "A13",
ContributionType::ILUSTRATOR => "A12",
ContributionType::ILLUSTRATOR => "A12",
ContributionType::FOREWORD_BY => "A23",
ContributionType::INTRODUCTION_BY => "A24",
ContributionType::AFTERWORD_BY => "A19",
Expand Down Expand Up @@ -704,7 +704,7 @@ mod tests {
test_contribution.contribution_type = ContributionType::PHOTOGRAPHER;
let output = generate_test_output(true, &test_contribution);
assert!(output.contains(r#" <ContributorRole>A13</ContributorRole>"#));
test_contribution.contribution_type = ContributionType::ILUSTRATOR;
test_contribution.contribution_type = ContributionType::ILLUSTRATOR;
let output = generate_test_output(true, &test_contribution);
assert!(output.contains(r#" <ContributorRole>A12</ContributorRole>"#));
test_contribution.contribution_type = ContributionType::FOREWORD_BY;
Expand Down
4 changes: 2 additions & 2 deletions thoth-export-server/src/xml/onix3_jstor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ impl XmlElement<Onix3Jstor> for ContributionType {
ContributionType::EDITOR => "B01",
ContributionType::TRANSLATOR => "B06",
ContributionType::PHOTOGRAPHER => "A13",
ContributionType::ILUSTRATOR => "A12",
ContributionType::ILLUSTRATOR => "A12",
ContributionType::MUSIC_EDITOR => "B25",
ContributionType::FOREWORD_BY => "A23",
ContributionType::INTRODUCTION_BY => "A24",
Expand Down Expand Up @@ -632,7 +632,7 @@ mod tests {
test_contribution.contribution_type = ContributionType::PHOTOGRAPHER;
let output = generate_test_output(true, &test_contribution);
assert!(output.contains(r#" <ContributorRole>A13</ContributorRole>"#));
test_contribution.contribution_type = ContributionType::ILUSTRATOR;
test_contribution.contribution_type = ContributionType::ILLUSTRATOR;
let output = generate_test_output(true, &test_contribution);
assert!(output.contains(r#" <ContributorRole>A12</ContributorRole>"#));
test_contribution.contribution_type = ContributionType::MUSIC_EDITOR;
Expand Down
4 changes: 2 additions & 2 deletions thoth-export-server/src/xml/onix3_oapen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ impl XmlElement<Onix3Oapen> for ContributionType {
ContributionType::EDITOR => "B01",
ContributionType::TRANSLATOR
| ContributionType::PHOTOGRAPHER
| ContributionType::ILUSTRATOR
| ContributionType::ILLUSTRATOR
| ContributionType::MUSIC_EDITOR
| ContributionType::FOREWORD_BY
| ContributionType::INTRODUCTION_BY
Expand Down Expand Up @@ -733,7 +733,7 @@ mod tests {
for contribution_type in [
ContributionType::TRANSLATOR,
ContributionType::PHOTOGRAPHER,
ContributionType::ILUSTRATOR,
ContributionType::ILLUSTRATOR,
ContributionType::MUSIC_EDITOR,
ContributionType::FOREWORD_BY,
ContributionType::INTRODUCTION_BY,
Expand Down
4 changes: 2 additions & 2 deletions thoth-export-server/src/xml/onix3_overdrive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ impl XmlElement<Onix3Overdrive> for ContributionType {
ContributionType::EDITOR => "B01",
ContributionType::TRANSLATOR => "B06",
ContributionType::PHOTOGRAPHER => "A13",
ContributionType::ILUSTRATOR => "A12",
ContributionType::ILLUSTRATOR => "A12",
ContributionType::MUSIC_EDITOR => "B25",
ContributionType::FOREWORD_BY => "A23",
ContributionType::INTRODUCTION_BY => "A24",
Expand Down Expand Up @@ -872,7 +872,7 @@ mod tests {
test_contribution.contribution_type = ContributionType::PHOTOGRAPHER;
let output = generate_test_output(true, &test_contribution);
assert!(output.contains(r#" <ContributorRole>A13</ContributorRole>"#));
test_contribution.contribution_type = ContributionType::ILUSTRATOR;
test_contribution.contribution_type = ContributionType::ILLUSTRATOR;
let output = generate_test_output(true, &test_contribution);
assert!(output.contains(r#" <ContributorRole>A12</ContributorRole>"#));
test_contribution.contribution_type = ContributionType::MUSIC_EDITOR;
Expand Down
4 changes: 2 additions & 2 deletions thoth-export-server/src/xml/onix3_project_muse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ impl XmlElement<Onix3ProjectMuse> for ContributionType {
ContributionType::EDITOR => "B01",
ContributionType::TRANSLATOR => "B06",
ContributionType::PHOTOGRAPHER => "A13",
ContributionType::ILUSTRATOR => "A12",
ContributionType::ILLUSTRATOR => "A12",
ContributionType::MUSIC_EDITOR => "B25",
ContributionType::FOREWORD_BY => "A23",
ContributionType::INTRODUCTION_BY => "A24",
Expand Down Expand Up @@ -647,7 +647,7 @@ mod tests {
test_contribution.contribution_type = ContributionType::PHOTOGRAPHER;
let output = generate_test_output(true, &test_contribution);
assert!(output.contains(r#" <ContributorRole>A13</ContributorRole>"#));
test_contribution.contribution_type = ContributionType::ILUSTRATOR;
test_contribution.contribution_type = ContributionType::ILLUSTRATOR;
let output = generate_test_output(true, &test_contribution);
assert!(output.contains(r#" <ContributorRole>A12</ContributorRole>"#));
test_contribution.contribution_type = ContributionType::MUSIC_EDITOR;
Expand Down

0 comments on commit 141ca6a

Please sign in to comment.