diff --git a/core/modules/workflows/config/schema/workflows.schema.yml b/core/modules/workflows/config/schema/workflows.schema.yml index 12328013ea6448d7ae752d9696cf9d4fd71ba0d2..42a5d9728a79209c245aa23f5395de1f6c60724d 100644 --- a/core/modules/workflows/config/schema/workflows.schema.yml +++ b/core/modules/workflows/config/schema/workflows.schema.yml @@ -13,7 +13,6 @@ workflows.workflow.*: label: 'Workflow type' type_settings: type: workflow.type_settings.[%parent.type] - label: 'Custom settings for workflow type' workflows.state: type: mapping diff --git a/core/modules/workflows/src/Annotation/WorkflowType.php b/core/modules/workflows/src/Annotation/WorkflowType.php index 755ac706d0c19fcfd44202ccddaf61b1e1431717..8ba6aec8407e732efdc0c5837c5d8fc2fb294969 100644 --- a/core/modules/workflows/src/Annotation/WorkflowType.php +++ b/core/modules/workflows/src/Annotation/WorkflowType.php @@ -12,7 +12,8 @@ * For a working example, see \Drupal\content_moderation\Plugin\Workflow\ContentModerate * * @see \Drupal\workflows\WorkflowTypeInterface - * @see \Drupal\workflows\WorkflowManager + * @see \Drupal\workflows\WorkflowTypeManager + * @see workflow_type_info_alter() * @see plugin_api * * @Annotation @@ -33,8 +34,6 @@ class WorkflowType extends Plugin { /** * The label of the workflow. * - * Describes how the plugin is used to apply a workflow to something. - * * @var \Drupal\Core\Annotation\Translation * * @ingroup plugin_translatable @@ -53,8 +52,10 @@ class WorkflowType extends Plugin { /** * A list of optional form classes implementing PluginFormInterface. * - * Forms which will be used for the workflow UI are 'configure', 'state' and - * 'transition'. + * Forms which will be used for the workflow UI are: + * - 'configure' (\Drupal\workflows\WorkflowTypeInterface::PLUGIN_FORM_KEY) + * - 'state' (\Drupal\workflows\StateInterface::PLUGIN_FORM_KEY) + * - 'transition' (\Drupal\workflows\TransitionInterface::PLUGIN_FORM_KEY) * * @see \Drupal\Core\Plugin\PluginWithFormsInterface * @see \Drupal\Core\Plugin\PluginFormInterface diff --git a/core/modules/workflows/src/Entity/Workflow.php b/core/modules/workflows/src/Entity/Workflow.php index 78762877c0f5570935fb616b94d6a2f39ddd8af4..b9031614da165ed692f17c65afc3dacfdfe093e8 100644 --- a/core/modules/workflows/src/Entity/Workflow.php +++ b/core/modules/workflows/src/Entity/Workflow.php @@ -32,7 +32,7 @@ * }, * "route_provider" = { * "html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider", - * } + * }, * }, * config_prefix = "workflow", * admin_permission = "administer workflows", @@ -47,13 +47,13 @@ * "delete-form" = "/admin/config/workflow/workflows/manage/{workflow}/delete", * "add-state-form" = "/admin/config/workflow/workflows/manage/{workflow}/add_state", * "add-transition-form" = "/admin/config/workflow/workflows/manage/{workflow}/add_transition", - * "collection" = "/admin/config/workflow/workflows" + * "collection" = "/admin/config/workflow/workflows", * }, * config_export = { * "id", * "label", * "type", - * "type_settings" + * "type_settings", * }, * ) * @@ -71,7 +71,7 @@ class Workflow extends ConfigEntityBase implements WorkflowInterface, EntityWith protected $id; /** - * The Moderation state label. + * The workflow label. * * @var string */ @@ -88,6 +88,7 @@ class Workflow extends ConfigEntityBase implements WorkflowInterface, EntityWith /** * The configuration for the workflow type plugin. + * * @var array */ protected $type_settings = []; diff --git a/core/modules/workflows/src/State.php b/core/modules/workflows/src/State.php index f6a377ba0f2b35e7d4991d33555d14c0708406f6..c40c2a7dfc565b1c37ebcdbbaf2ed4b6bdd84f2f 100644 --- a/core/modules/workflows/src/State.php +++ b/core/modules/workflows/src/State.php @@ -104,7 +104,7 @@ public function getTransitions() { } /** - * Helper method to convert a list of states to labels + * Helper method to convert a State value object to a label. * * @param \Drupal\workflows\StateInterface $state * diff --git a/core/modules/workflows/src/StateInterface.php b/core/modules/workflows/src/StateInterface.php index 5a5442bb1d6c53d1a71e4905471be7c409828cab..6cc8ace95c978a97a99ae6dce6faca62dc893c00 100644 --- a/core/modules/workflows/src/StateInterface.php +++ b/core/modules/workflows/src/StateInterface.php @@ -6,8 +6,8 @@ * An interface for state value objects. * * @internal - * The workflow system is currently experimental and should only be leveraged - * by experimental modules and development releases of contributed modules. + * The StateInterface should only be used by Workflows and Content Moderation. + * @todo Revisit the need for this in https://www.drupal.org/node/2902309. */ interface StateInterface { diff --git a/core/modules/workflows/src/TransitionInterface.php b/core/modules/workflows/src/TransitionInterface.php index 14f6d1487c6fc071914300a951cd60d5bda4131e..0fa159cabfb77ec1a945bc8ff64201285d67c5c1 100644 --- a/core/modules/workflows/src/TransitionInterface.php +++ b/core/modules/workflows/src/TransitionInterface.php @@ -6,8 +6,9 @@ * A transition value object that describes the transition between two states. * * @internal - * The workflow system is currently experimental and should only be leveraged - * by experimental modules and development releases of contributed modules. + * The TransitionInterface should only be used by Workflows and Content + * Moderation. + * @todo Revisit the need for this in https://www.drupal.org/node/2902309. */ interface TransitionInterface { diff --git a/core/modules/workflows/src/WorkflowTypeInterface.php b/core/modules/workflows/src/WorkflowTypeInterface.php index 0d9107104a523c2296205bae975aedb6087e8b98..4ffa4d07a1c4a35d9314a993cdadb60710173d9a 100644 --- a/core/modules/workflows/src/WorkflowTypeInterface.php +++ b/core/modules/workflows/src/WorkflowTypeInterface.php @@ -71,9 +71,9 @@ public function getInitialState(); /** * Gets the required states of workflow type. * - * This are usually configured in the workflow type annotation. + * This is usually specified in the workflow type annotation. * - * @return array[] + * @return string[] * The required states. * * @see \Drupal\workflows\Annotation\WorkflowType @@ -103,8 +103,7 @@ public function onDependencyRemoval(array $dependencies); * @param string $label * The state's label. * - * @return \Drupal\workflows\WorkflowTypeInterface - * The workflow type plugin. + * @return $this * * @throws \InvalidArgumentException * Thrown if a state already exists or state ID is invalid. @@ -158,8 +157,7 @@ public function getState($state_id); * @param string $label * The state's label. * - * @return \Drupal\workflows\WorkflowTypeInterface - * The workflow type plugin. + * @return $this */ public function setStateLabel($state_id, $label); @@ -171,8 +169,7 @@ public function setStateLabel($state_id, $label); * @param int $weight * The state's weight. * - * @return \Drupal\workflows\WorkflowTypeInterface - * The workflow type plugin. + * @return $this */ public function setStateWeight($state_id, $weight); @@ -202,8 +199,7 @@ public function deleteState($state_id); * @param string $to_state_id * The state ID to transition to. * - * @return \Drupal\workflows\WorkflowTypeInterface - * The workflow type plugin. + * @return $this * * @throws \InvalidArgumentException * Thrown if either state does not exist. @@ -301,8 +297,7 @@ public function hasTransitionFromStateToState($from_state_id, $to_state_id); * @param string $label * The transition's label. * - * @return \Drupal\workflows\WorkflowTypeInterface - * The workflow type plugin. + * @return $this * * @throws \InvalidArgumentException * Thrown if the transition does not exist. @@ -317,8 +312,7 @@ public function setTransitionLabel($transition_id, $label); * @param int $weight * The transition's weight. * - * @return \Drupal\workflows\WorkflowTypeInterface - * The workflow type plugin. + * @return $this * * @throws \InvalidArgumentException * Thrown if the transition does not exist. @@ -333,13 +327,12 @@ public function setTransitionWeight($transition_id, $weight); * @param array $from_state_ids * The state IDs to transition from. * - * @return \Drupal\workflows\WorkflowTypeInterface - * The workflow type plugin. + * @return $this * * @throws \InvalidArgumentException * Thrown if the transition does not exist or the states do not exist. */ - public function setTransitionFromStates($transition_id, array $from_state_ids); + public function setTransitionFromStates($transition_id, array $from_state_ids); /** * Deletes a transition. @@ -347,8 +340,7 @@ public function setTransitionFromStates($transition_id, array $from_state_ids) * @param string $transition_id * The transition ID. * - * @return \Drupal\workflows\WorkflowTypeInterface - * The workflow type plugin. + * @return $this * * @throws \InvalidArgumentException * Thrown if the transition does not exist. diff --git a/core/modules/workflows/workflows.info.yml b/core/modules/workflows/workflows.info.yml index 0089a123d81cff54f0f5b8197b37ff4730fd9964..4f307d1513de7ba7a5fba4fc73361f6959fc26e8 100644 --- a/core/modules/workflows/workflows.info.yml +++ b/core/modules/workflows/workflows.info.yml @@ -1,6 +1,6 @@ name: 'Workflows' type: module -description: 'Provides UI and API for managing workflows. This module can be used with the Content moderation module to add highly customisable workflows to content.' +description: 'Provides UI and API for managing workflows. This module can be used with the Content moderation module to add highly customizable workflows to content.' version: VERSION core: 8.x package: Core (Experimental) diff --git a/core/modules/workflows/workflows.links.menu.yml b/core/modules/workflows/workflows.links.menu.yml index a6ac512980a3015c3d81494ca5c9eea6cb5cb74a..ca191d5f32be9cd6a43834418194dcafc08d5d44 100644 --- a/core/modules/workflows/workflows.links.menu.yml +++ b/core/modules/workflows/workflows.links.menu.yml @@ -1,4 +1,3 @@ -# Workflow menu items definition entity.workflow.collection: title: 'Workflows' route_name: entity.workflow.collection diff --git a/core/modules/workflows/workflows.module b/core/modules/workflows/workflows.module index 096fd92e0e6f9bb5b57d629e306d7201a19cd90d..f72d7bd32c9aacd9d33ca3ae64f0a73b44237243 100644 --- a/core/modules/workflows/workflows.module +++ b/core/modules/workflows/workflows.module @@ -2,7 +2,7 @@ /** * @file - * Provides hook implementations for the Workflow UI module. + * Provides hook implementations for the Workflows module. */ use Drupal\Core\Routing\RouteMatchInterface; @@ -12,7 +12,6 @@ */ function workflows_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { - // Main module help for the Workflow UI module. case 'help.page.workflows': $output = ''; $output .= '

' . t('About') . '

';