Skip to content

Commit

Permalink
Merge branch '4.x' into company_id-search-command
Browse files Browse the repository at this point in the history
  • Loading branch information
RCheesley committed Apr 7, 2022
2 parents 1ff761f + a9fd72e commit f4bbb65
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ jobs:
name: Upload release asset to m.mautic.org
needs: [release, test-fresh-install, test-update-install]
# We only want this job to run in Mautic's repo, not in forks
if: github.repository_owner == 'mautic'
if: github.repository_owner == 'mautic' && env.IS_PRERELEASE != true
runs-on: ubuntu-latest

steps:
Expand Down
27 changes: 13 additions & 14 deletions app/bundles/CoreBundle/Event/BuilderEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,19 @@ function ($a, $b) {
/**
* Adds an A/B test winner criteria option.
*
* @param string $key - a unique identifier; it is recommended that it be namespaced i.e. lead.points
* @param array $criteria - can contain the following keys:
* 'group' => (required) translation string to group criteria by in the dropdown select list
* 'label' => (required) what to display in the list
* 'formType' => (optional) name of the form type SERVICE for the criteria
* 'formTypeOptions' => (optional) array of options to pass to the formType service
* 'callback' => (required) callback function that will be passed the parent page or email for winner determination
* The callback function can receive the following arguments by name (via ReflectionMethod::invokeArgs())
* array $properties - values saved from the formType as defined here; keyed by page or email id in the case of
* multiple variants
* Mautic\CoreBundle\Factory\MauticFactory $factory
* Mautic\PageBundle\Entity\Page $page | Mautic\EmailBundle\Entity\Email $email (depending on the context)
* Mautic\PageBundle\Entity\Page|Mautic\EmailBundle\Entity\Email $parent
* Doctrine\Common\Collections\ArrayCollection $children
* @param string $key - a unique identifier; it is recommended that it be namespaced i.e. lead.points
* @param array{
* group: string,
* label: string,
* event: string,
* formType?: string,
* formTypeOptions?: string
* } $criteria Can contain the following keys:
* - group - (required) translation string to group criteria by in the dropdown select list
* - label - (required) what to display in the list
* - event - (required) event class constant that will receieve the DetermineWinnerEvent for further handling. E.g. `HelloWorldEvents::ON_DETERMINE_PLANET_VISIT_WINNER`
* - formType - (optional) name of the form type SERVICE for the criteria
* - formTypeOptions - (optional) array of options to pass to the formType service
*/
public function addAbTestWinnerCriteria($key, array $criteria)
{
Expand Down
46 changes: 41 additions & 5 deletions app/bundles/CoreBundle/Event/DetermineWinnerEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,73 @@
class DetermineWinnerEvent extends Event
{
/**
* @var array
* @var array{
* parent?: \Mautic\PageBundle\Entity\Page|\Mautic\EmailBundle\Entity\Email,
* children?: array<mixed>,
* page?: \Mautic\PageBundle\Entity\Page,
* email?: \Mautic\EmailBundle\Entity\Email
* }
*/
private $parameters;

/**
* @var array
* @var array{
* winners: array,
* support?: mixed,
* supportTemplate?: string
* }
*/
private $abTestResults;

/**
* @param array{
* parent?: \Mautic\PageBundle\Entity\Page|\Mautic\EmailBundle\Entity\Email,
* children?: array<mixed>,
* page?: \Mautic\PageBundle\Entity\Page,
* email?: \Mautic\EmailBundle\Entity\Email
* } $parameters
*/
public function __construct(array $parameters)
{
$this->parameters = $parameters;
}

/**
* @return array
* @return array{
* parent?: \Mautic\PageBundle\Entity\Page|\Mautic\EmailBundle\Entity\Email,
* children?: array<mixed>,
* page?: \Mautic\PageBundle\Entity\Page,
* email?: \Mautic\EmailBundle\Entity\Email
* }
*/
public function getParameters()
{
return $this->parameters;
}

/**
* @return array
* @return array{
* winners:array,
* support?:mixed,
* supportTemplate?:string
* }
*/
public function getAbTestResults()
{
return $this->abTestResults;
}

public function setAbTestResults(array $abTestResults)
/**
* @param array{
* winners:array,
* support?:mixed,
* supportTemplate?:string
* } $abTestResults The following parameters are available:
* - (required) winners - Array of IDs of the winners (empty array in case of a tie)
* - (optional) support - Data passed to the view defined by supportTemplate below in order to render visual support for the winners (such as a graph, etc)
* - (optional) supportTemplate - View notation to render content for the A/B stats modal. For example, `HelloWorldBundle:SubscribedEvents\AbTest:graph.html.php`
*/
public function setAbTestResults(array $abTestResults): void
{
$this->abTestResults = $abTestResults;
}
Expand Down
4 changes: 2 additions & 2 deletions app/bundles/CoreBundle/Test/MauticMysqlTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Mautic\InstallBundle\InstallFixtures\ORM\RoleData;
use Mautic\UserBundle\DataFixtures\ORM\LoadRoleData;
use Mautic\UserBundle\DataFixtures\ORM\LoadUserData;
use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Component\Process\Process;

abstract class MauticMysqlTestCase extends AbstractMauticTestCase
Expand Down Expand Up @@ -105,7 +105,7 @@ protected function resetAutoincrement(array $tables): void
}
}

protected function createAnotherClient(string $username = 'admin', string $password = 'mautic'): Client
protected function createAnotherClient(string $username = 'admin', string $password = 'mautic'): KernelBrowser
{
// turn off rollback cleanup as this client creates a separate DB connection
$this->useCleanupRollback = false;
Expand Down
4 changes: 2 additions & 2 deletions app/bundles/LeadBundle/Assets/css/lead.css
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ ul.tag-cloud li {
}

.frequency{
width: 45px!important;
width: 65px!important;
}

.contact{
Expand All @@ -222,7 +222,7 @@ ul.tag-cloud li {
}

.frequency-select {
width:145px !important;
width:125px !important;
float: right;
padding-right: 5px;
}
Expand Down
1 change: 0 additions & 1 deletion app/bundles/LeadBundle/Form/Type/ContactChannelsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'frequency_number_'.$channel,
IntegerType::class,
[
'scale' => 0,
'label' => 'mautic.lead.list.frequency.number',
'label_attr' => ['class' => 'text-muted fw-n label1'],
'attr' => array_merge(
Expand Down

0 comments on commit f4bbb65

Please sign in to comment.