From 90e5926865ae7dc74aaff8474902cecfb86a3a0e Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 14 Dec 2023 15:23:57 +1300 Subject: [PATCH 1/3] MNT Update @methods on class docblocks --- src/Actions/AssignUsersToWorkflowAction.php | 2 ++ src/Actions/SetPropertyWorkflowAction.php | 2 -- src/Actions/UnpublishItemWorkflowAction.php | 4 ++-- src/DataObjects/ImportedWorkflowTemplate.php | 1 + src/DataObjects/WorkflowAction.php | 4 +++- src/DataObjects/WorkflowActionInstance.php | 3 +++ src/DataObjects/WorkflowDefinition.php | 4 ++++ src/DataObjects/WorkflowInstance.php | 10 ++++++---- src/DataObjects/WorkflowTransition.php | 6 ++++-- src/Extensions/WorkflowApplicable.php | 2 ++ src/Extensions/WorkflowEmbargoExpiryExtension.php | 2 ++ 11 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/Actions/AssignUsersToWorkflowAction.php b/src/Actions/AssignUsersToWorkflowAction.php index 67cdc696..9a5af590 100644 --- a/src/Actions/AssignUsersToWorkflowAction.php +++ b/src/Actions/AssignUsersToWorkflowAction.php @@ -20,6 +20,8 @@ * @license BSD License (http://silverstripe.org/bsd-license/) * @package advancedworkflow * @subpackage actions + * @method SilverStripe\ORM\ManyManyList Groups() + * @method SilverStripe\ORM\ManyManyList Users() */ class AssignUsersToWorkflowAction extends WorkflowAction { diff --git a/src/Actions/SetPropertyWorkflowAction.php b/src/Actions/SetPropertyWorkflowAction.php index 3ed5b382..0f662dd5 100644 --- a/src/Actions/SetPropertyWorkflowAction.php +++ b/src/Actions/SetPropertyWorkflowAction.php @@ -7,8 +7,6 @@ use Symbiote\AdvancedWorkflow\DataObjects\WorkflowInstance; /** - * - * * @author Marcus Nyeholt */ class SetPropertyWorkflowAction extends WorkflowAction diff --git a/src/Actions/UnpublishItemWorkflowAction.php b/src/Actions/UnpublishItemWorkflowAction.php index ece9f5b0..d3903cfa 100644 --- a/src/Actions/UnpublishItemWorkflowAction.php +++ b/src/Actions/UnpublishItemWorkflowAction.php @@ -10,8 +10,8 @@ use Symbiote\AdvancedWorkflow\DataObjects\WorkflowInstance; use Symbiote\AdvancedWorkflow\Extensions\WorkflowEmbargoExpiryExtension; use Symbiote\AdvancedWorkflow\Jobs\WorkflowPublishTargetJob; -use Symbiote\QueuedJob\Services\AbstractQueuedJob; -use Symbiote\QueuedJob\Services\QueuedJobService; +use Symbiote\QueuedJobs\Services\AbstractQueuedJob; +use Symbiote\QueuedJobs\Services\QueuedJobService; /** * Unpublishes an item diff --git a/src/DataObjects/ImportedWorkflowTemplate.php b/src/DataObjects/ImportedWorkflowTemplate.php index 68691711..3481939c 100644 --- a/src/DataObjects/ImportedWorkflowTemplate.php +++ b/src/DataObjects/ImportedWorkflowTemplate.php @@ -11,6 +11,7 @@ * @author russell@silverstripe.com * @license BSD License (http://silverstripe.org/bsd-license/) * @package advancedworkflow + * @method WorkflowDefinition Definition() */ class ImportedWorkflowTemplate extends DataObject { diff --git a/src/DataObjects/WorkflowAction.php b/src/DataObjects/WorkflowAction.php index c61ae5f0..a2530cbd 100644 --- a/src/DataObjects/WorkflowAction.php +++ b/src/DataObjects/WorkflowAction.php @@ -21,10 +21,12 @@ * the action(s) that occur while in that state. An action can then have * subsequent transitions out of the current state. * - * @method WorkflowDefinition WorkflowDef() * @author marcus@symbiote.com.au * @license BSD License (http://silverstripe.org/bsd-license/) * @package advancedworkflow + * @method Member Member() + * @method SilverStripe\ORM\HasManyList Transitions() + * @method WorkflowDefinition WorkflowDef() */ class WorkflowAction extends DataObject { diff --git a/src/DataObjects/WorkflowActionInstance.php b/src/DataObjects/WorkflowActionInstance.php index 259b7be9..fc39fb02 100644 --- a/src/DataObjects/WorkflowActionInstance.php +++ b/src/DataObjects/WorkflowActionInstance.php @@ -22,6 +22,9 @@ * * @license BSD License (http://silverstripe.org/bsd-license/) * @package advancedworkflow + * @method WorkflowAction BaseAction() + * @method Member Member() + * @method WorkflowInstance Workflow() */ class WorkflowActionInstance extends DataObject { diff --git a/src/DataObjects/WorkflowDefinition.php b/src/DataObjects/WorkflowDefinition.php index 9e8360db..6a90ab0f 100644 --- a/src/DataObjects/WorkflowDefinition.php +++ b/src/DataObjects/WorkflowDefinition.php @@ -49,6 +49,10 @@ * @author marcus@symbiote.com.au * @license BSD License (http://silverstripe.org/bsd-license/) * @package advancedworkflow + * @method SilverStripe\ORM\HasManyList Actions() + * @method SilverStripe\ORM\ManyManyList Groups() + * @method SilverStripe\ORM\HasManyList Instances() + * @method SilverStripe\ORM\ManyManyList Users() */ class WorkflowDefinition extends DataObject { diff --git a/src/DataObjects/WorkflowInstance.php b/src/DataObjects/WorkflowInstance.php index 54c2b8f6..da1c0fe9 100644 --- a/src/DataObjects/WorkflowInstance.php +++ b/src/DataObjects/WorkflowInstance.php @@ -38,13 +38,15 @@ * button (eg 'apply for approval'). This creates a standalone object * that maintains the state of the workflow process. * - * @method WorkflowDefinition Definition() - * @method WorkflowActionInstance CurrentAction() - * @method Member Initiator() - * * @author marcus@symbiote.com.au * @license BSD License (http://silverstripe.org/bsd-license/) * @package advancedworkflow + * @method SilverStripe\ORM\HasManyList Actions() + * @method WorkflowActionInstance CurrentAction() + * @method WorkflowDefinition Definition() + * @method SilverStripe\ORM\ManyManyList Groups() + * @method Member Initiator() + * @method SilverStripe\ORM\ManyManyList Users() */ class WorkflowInstance extends DataObject { diff --git a/src/DataObjects/WorkflowTransition.php b/src/DataObjects/WorkflowTransition.php index 39937c9c..c0ee7e11 100644 --- a/src/DataObjects/WorkflowTransition.php +++ b/src/DataObjects/WorkflowTransition.php @@ -27,11 +27,13 @@ * Therefore, any logic around whether the workflow can proceed should be * managed within this method. * - * @method WorkflowAction Action() - * @method WorkflowAction NextAction() * @author marcus@symbiote.com.au * @license BSD License (http://silverstripe.org/bsd-license/) * @package advancedworkflow + * @method WorkflowAction Action() + * @method SilverStripe\ORM\ManyManyList Groups() + * @method WorkflowAction NextAction() + * @method SilverStripe\ORM\ManyManyList Users() */ class WorkflowTransition extends DataObject { diff --git a/src/Extensions/WorkflowApplicable.php b/src/Extensions/WorkflowApplicable.php index 6debcbd3..431819ce 100644 --- a/src/Extensions/WorkflowApplicable.php +++ b/src/Extensions/WorkflowApplicable.php @@ -35,6 +35,8 @@ * @author marcus@symbiote.com.au * @license BSD License (http://silverstripe.org/bsd-license/) * @package advancedworkflow + * @method SilverStripe\ORM\ManyManyList AdditionalWorkflowDefinitions() + * @method WorkflowDefinition WorkflowDefinition() */ class WorkflowApplicable extends DataExtension { diff --git a/src/Extensions/WorkflowEmbargoExpiryExtension.php b/src/Extensions/WorkflowEmbargoExpiryExtension.php index f0d67443..0fd7bcd7 100644 --- a/src/Extensions/WorkflowEmbargoExpiryExtension.php +++ b/src/Extensions/WorkflowEmbargoExpiryExtension.php @@ -35,6 +35,8 @@ * * @author marcus@symbiote.com.au * @license BSD License http://silverstripe.org/bsd-license/ + * @method QueuedJobDescriptor PublishJob() + * @method QueuedJobDescriptor UnPublishJob() */ class WorkflowEmbargoExpiryExtension extends DataExtension { From 5e3b9b0f246a7fb5cf7d4314d620f398f7fb4b65 Mon Sep 17 00:00:00 2001 From: Mohamed Alsharaf Date: Thu, 25 Jan 2024 16:32:04 +1300 Subject: [PATCH 2/3] FIX Button layout that display icons Related issue https://github.com/silverstripe/silverstripe-cms/issues/2885 --- src/Extensions/WorkflowApplicable.php | 1 - .../Symbiote/AdvancedWorkflow/FormFields/WorkflowField.ss | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Extensions/WorkflowApplicable.php b/src/Extensions/WorkflowApplicable.php index 431819ce..1ac12431 100644 --- a/src/Extensions/WorkflowApplicable.php +++ b/src/Extensions/WorkflowApplicable.php @@ -256,7 +256,6 @@ public function updateCMSActions(FieldList $actions) // and will be displayed as a major action. if (!$addedFirst) { $addedFirst = true; - $action->setAttribute('data-icon', 'navigation'); $majorActions = $actions->fieldByName('MajorActions'); $majorActions ? $majorActions->push($action) : $actions->push($action); } else { diff --git a/templates/Symbiote/AdvancedWorkflow/FormFields/WorkflowField.ss b/templates/Symbiote/AdvancedWorkflow/FormFields/WorkflowField.ss index b20a8646..62006aff 100644 --- a/templates/Symbiote/AdvancedWorkflow/FormFields/WorkflowField.ss +++ b/templates/Symbiote/AdvancedWorkflow/FormFields/WorkflowField.ss @@ -30,13 +30,13 @@

$Title

From 8f08322f83259c8605540696e0446c89277f55ce Mon Sep 17 00:00:00 2001 From: Mohamed Alsharaf Date: Thu, 25 Jan 2024 16:32:49 +1300 Subject: [PATCH 3/3] FIX Argument order of insertBefore method --- src/Extensions/WorkflowApplicable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Extensions/WorkflowApplicable.php b/src/Extensions/WorkflowApplicable.php index 1ac12431..7221de38 100644 --- a/src/Extensions/WorkflowApplicable.php +++ b/src/Extensions/WorkflowApplicable.php @@ -265,7 +265,7 @@ public function updateCMSActions(FieldList $actions) } // Only display menu if actions pushed to it if ($tab->Fields()->exists()) { - $menu->insertBefore($tab, 'MoreOptions'); + $menu->insertBefore('MoreOptions', $tab); } } }