Skip to content

Commit

Permalink
draft-api: Skip publishing roles when republishing a draft
Browse files Browse the repository at this point in the history
  • Loading branch information
jnatten committed Jan 22, 2025
1 parent 8fdfc7f commit 3d7e3ba
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,54 +139,54 @@ trait StateTransitionRules {
(IN_PROGRESS -> INTERNAL_REVIEW) keepCurrentOnTransition,
(IN_PROGRESS -> QUALITY_ASSURANCE) .require(PublishRoles, articleHasBeenPublished) keepStates Set(PUBLISHED),
(IN_PROGRESS -> LANGUAGE) .require(PublishRoles, articleHasBeenPublished) keepStates Set(PUBLISHED),
(IN_PROGRESS -> PUBLISHED) require DirectPublishRoles withSideEffect publishWithSoftValidation withSideEffect resetResponsible,
(IN_PROGRESS -> PUBLISHED) .require(DirectPublishRoles, articleHasBeenPublished) withSideEffect publishWithSoftValidation withSideEffect resetResponsible,
(IN_PROGRESS -> ARCHIVED) .require(PublishRoles, articleHasNotBeenPublished) withIllegalStatuses Set(PUBLISHED) withSideEffect resetResponsible,
(IN_PROGRESS -> REPUBLISH) .require(PublishRoles, articleHasBeenPublished) keepStates Set(PUBLISHED) requireStatusesForTransition Set(PUBLISHED),
EXTERNAL_REVIEW -> IN_PROGRESS keepStates Set(PUBLISHED),
(EXTERNAL_REVIEW -> EXTERNAL_REVIEW) keepStates Set(IN_PROGRESS, PUBLISHED),
(EXTERNAL_REVIEW -> INTERNAL_REVIEW) keepStates Set(PUBLISHED) keepCurrentOnTransition,
(EXTERNAL_REVIEW -> PUBLISHED) require DirectPublishRoles withSideEffect publishWithSoftValidation withSideEffect resetResponsible,
(EXTERNAL_REVIEW -> PUBLISHED) .require(DirectPublishRoles, articleHasBeenPublished) withSideEffect publishWithSoftValidation withSideEffect resetResponsible,
(EXTERNAL_REVIEW -> ARCHIVED) .require(PublishRoles, articleHasNotBeenPublished) withIllegalStatuses Set(PUBLISHED) withSideEffect resetResponsible,
INTERNAL_REVIEW -> IN_PROGRESS,
(INTERNAL_REVIEW -> EXTERNAL_REVIEW) keepStates Set(INTERNAL_REVIEW, PUBLISHED),
INTERNAL_REVIEW -> INTERNAL_REVIEW,
(INTERNAL_REVIEW -> QUALITY_ASSURANCE) keepCurrentOnTransition,
(INTERNAL_REVIEW -> PUBLISHED) require DirectPublishRoles withSideEffect publishWithSoftValidation withSideEffect resetResponsible,
(INTERNAL_REVIEW -> PUBLISHED) .require(DirectPublishRoles, articleHasBeenPublished) withSideEffect publishWithSoftValidation withSideEffect resetResponsible,
(INTERNAL_REVIEW -> ARCHIVED) .require(PublishRoles, articleHasNotBeenPublished) withIllegalStatuses Set(PUBLISHED) withSideEffect resetResponsible,
(QUALITY_ASSURANCE -> IN_PROGRESS) keepStates Set(PUBLISHED),
(QUALITY_ASSURANCE -> INTERNAL_REVIEW) keepStates Set(PUBLISHED),
QUALITY_ASSURANCE -> QUALITY_ASSURANCE,
(QUALITY_ASSURANCE -> LANGUAGE) keepStates Set(PUBLISHED) require DirectPublishRoles,
(QUALITY_ASSURANCE -> ARCHIVED) .require(PublishRoles, articleHasNotBeenPublished) withIllegalStatuses Set(PUBLISHED) withSideEffect resetResponsible,
(QUALITY_ASSURANCE -> PUBLISHED) require PublishRoles withSideEffect publishArticle withSideEffect resetResponsible,
(QUALITY_ASSURANCE -> PUBLISHED) .require(PublishRoles, articleHasBeenPublished) withSideEffect publishArticle withSideEffect resetResponsible,
LANGUAGE -> IN_PROGRESS,
(LANGUAGE -> QUALITY_ASSURANCE) keepCurrentOnTransition,
LANGUAGE -> LANGUAGE,
(LANGUAGE -> FOR_APPROVAL) keepStates Set(PUBLISHED) require DirectPublishRoles,
(LANGUAGE -> PUBLISHED) require PublishRoles withSideEffect publishArticle withSideEffect resetResponsible,
(LANGUAGE -> PUBLISHED) .require(PublishRoles, articleHasBeenPublished) withSideEffect publishArticle withSideEffect resetResponsible,
(LANGUAGE -> ARCHIVED) .require(PublishRoles, articleHasNotBeenPublished) withIllegalStatuses Set(PUBLISHED) withSideEffect resetResponsible,
(FOR_APPROVAL -> IN_PROGRESS) keepStates Set(PUBLISHED),
(FOR_APPROVAL -> LANGUAGE) keepStates Set(PUBLISHED),
FOR_APPROVAL -> FOR_APPROVAL,
(FOR_APPROVAL -> END_CONTROL) keepStates Set(PUBLISHED) withSideEffect validateArticleApiArticle,
(FOR_APPROVAL -> PUBLISHED) require PublishRoles withSideEffect publishArticle withSideEffect resetResponsible,
(FOR_APPROVAL -> PUBLISHED) .require(PublishRoles, articleHasBeenPublished) withSideEffect publishArticle withSideEffect resetResponsible,
(FOR_APPROVAL -> ARCHIVED) .require(PublishRoles, articleHasNotBeenPublished) withIllegalStatuses Set(PUBLISHED) withSideEffect resetResponsible,
(END_CONTROL -> IN_PROGRESS) keepStates Set(PUBLISHED),
(END_CONTROL -> FOR_APPROVAL) keepStates Set(PUBLISHED),
(END_CONTROL -> END_CONTROL) withSideEffect validateArticleApiArticle,
(END_CONTROL -> PUBLISH_DELAYED) require DirectPublishRoles withSideEffect validateArticleApiArticle,
(END_CONTROL -> PUBLISHED) require DirectPublishRoles withSideEffect publishArticle withSideEffect resetResponsible,
(END_CONTROL -> PUBLISHED) .require(DirectPublishRoles, articleHasBeenPublished) withSideEffect publishArticle withSideEffect resetResponsible,
(END_CONTROL -> ARCHIVED) .require(PublishRoles, articleHasNotBeenPublished) withIllegalStatuses Set(PUBLISHED) withSideEffect resetResponsible,
(PUBLISH_DELAYED -> END_CONTROL) keepStates Set(PUBLISHED) withSideEffect validateArticleApiArticle,
PUBLISH_DELAYED -> PUBLISH_DELAYED,
(PUBLISH_DELAYED -> PUBLISHED) require DirectPublishRoles withSideEffect publishArticle withSideEffect resetResponsible,
(PUBLISH_DELAYED -> PUBLISHED) .require(DirectPublishRoles, articleHasBeenPublished) withSideEffect publishArticle withSideEffect resetResponsible,
(PUBLISH_DELAYED -> ARCHIVED) .require(PublishRoles, articleHasNotBeenPublished) withIllegalStatuses Set(PUBLISHED) withSideEffect resetResponsible,
(PUBLISHED -> IN_PROGRESS) keepStates Set(PUBLISHED) withSideEffect addResponsible keepCurrentOnTransition,
(PUBLISHED -> UNPUBLISHED) keepStates Set.empty require DirectPublishRoles withSideEffect unpublishArticle withSideEffect resetResponsible,
(PUBLISHED -> ARCHIVED) .require(PublishRoles, articleHasNotBeenPublished) withIllegalStatuses Set(PUBLISHED) withSideEffect unpublishArticle withSideEffect resetResponsible,
REPUBLISH -> REPUBLISH,
REPUBLISH -> IN_PROGRESS keepStates Set(PUBLISHED),
(REPUBLISH -> PUBLISHED) require PublishRoles withSideEffect publishArticle withSideEffect resetResponsible,
(REPUBLISH -> PUBLISHED) .require(PublishRoles, articleHasBeenPublished) withSideEffect publishArticle withSideEffect resetResponsible,
UNPUBLISHED -> UNPUBLISHED withSideEffect resetResponsible,
(UNPUBLISHED -> PUBLISHED) require DirectPublishRoles withSideEffect publishWithSoftValidation withSideEffect resetResponsible,
UNPUBLISHED -> IN_PROGRESS,
Expand Down

0 comments on commit 3d7e3ba

Please sign in to comment.