Skip to content

Commit

Permalink
Added more specificity to changelog, minor variable renaming for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-oconnell committed May 31, 2024
1 parent f5d376d commit f00fbd4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Changed
- [595](https://github.com/thoth-pub/thoth/issues/595) - Remove infrequently and unused work statuses, require a publication date for active works in Thoth
- [595](https://github.com/thoth-pub/thoth/issues/595) - Remove infrequently used and unused work statuses (unspecified, no longer our product, out of stock indefinitely, out of print, inactive, unknown, remaindered, recalled). Require a publication date for active, withdrawn from sale, and superseded works in Thoth.

### Added
- [595](https://github.com/thoth-pub/thoth/issues/595) - Add a new `Superseded` work status
- [595](https://github.com/thoth-pub/thoth/issues/595) - Add a new `Superseded` work status to replace Out of Print for older editions of Works. Require a withdrawn from sale date for Superseded works.

## [[0.12.5]](https://github.com/thoth-pub/thoth/releases/tag/v0.12.5) - 2024-05-07
### Changed
Expand Down
2 changes: 1 addition & 1 deletion thoth-api/src/model/work/crud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ where
Self: WorkProperties,
{
fn validate(&self) -> ThothResult<()> {
self.active_no_publication_date_error()?;
self.active_withdrawn_superseded_no_publication_date_error()?;
self.withdrawn_date_error()?;
self.no_withdrawn_date_error()?;
self.withdrawn_date_before_publication_date_error()
Expand Down
4 changes: 2 additions & 2 deletions thoth-api/src/model/work/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl WorkStatus {
fn is_active_withdrawn_superseded(&self) -> bool {
matches!(
self,
WorkStatus::Active | WorkStatus::Superseded | WorkStatus::WithdrawnFromSale
WorkStatus::Active | WorkStatus::WithdrawnFromSale | WorkStatus::Superseded
)
}
}
Expand All @@ -355,7 +355,7 @@ pub trait WorkProperties {
self.publication_date().is_some()
}

fn active_no_publication_date_error(&self) -> ThothResult<()> {
fn active_withdrawn_superseded_no_publication_date_error(&self) -> ThothResult<()> {
if self.is_active_withdrawn_superseded() && !self.has_publication_date() {
return Err(ThothError::PublicationDateError);
}
Expand Down
2 changes: 1 addition & 1 deletion thoth-app/src/component/new_work.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ impl Component for NewWorkComponent {
label = "Withdrawn Date"
value={ self.work.withdrawn_date.clone() }
oninput={ ctx.link().callback(|e: InputEvent| Msg::ChangeWithdrawnDate(e.to_value())) }
required = true
required = { !is_not_withdrawn_or_superseded }
deactivated={ is_not_withdrawn_or_superseded }
/>
<FormTextInput
Expand Down
2 changes: 1 addition & 1 deletion thoth-app/src/component/work.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ impl Component for WorkComponent {
label = "Withdrawn Date"
value={ self.work.withdrawn_date.clone() }
oninput={ ctx.link().callback(|e: InputEvent| Msg::ChangeWithdrawnDate(e.to_value())) }
required = true
required ={ !is_not_withdrawn_or_superseded }
deactivated={ is_not_withdrawn_or_superseded }
/>
<FormTextInput
Expand Down

0 comments on commit f00fbd4

Please sign in to comment.