Modal clear_on_close/notify_on_close defaults to TRUE, change MultiExternalSelect initial_options to be a collection
This commit is contained in:
parent
b289f29948
commit
1923f4486b
@ -67,7 +67,7 @@ final class MultiStaticSelect extends Element
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initial_options(array $initial=NULL): self
|
public function initial_options(Collection $initial=NULL): self
|
||||||
{
|
{
|
||||||
// No initial options.
|
// No initial options.
|
||||||
if (count($initial)) {
|
if (count($initial)) {
|
||||||
@ -77,7 +77,7 @@ final class MultiStaticSelect extends Element
|
|||||||
if (count($initial) > self::MAX_OPTIONS)
|
if (count($initial) > self::MAX_OPTIONS)
|
||||||
throw new SlackSyntaxException(sprintf('Can only have maximum %d options',self::MAX_OPTIONS));
|
throw new SlackSyntaxException(sprintf('Can only have maximum %d options',self::MAX_OPTIONS));
|
||||||
|
|
||||||
$this->initial_options = $this->options->filter(function($item) use ($initial) { return in_array($item['value'],$initial); });
|
$this->initial_options = $this->options->filter(function($item) use ($initial) { return $initial->contains($item['value']); });
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -89,7 +89,7 @@ final class Modal extends BlockKit
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clear_on_close(bool $bool): self
|
public function clear_on_close(bool $bool=TRUE): self
|
||||||
{
|
{
|
||||||
if ($this->type != 'modal')
|
if ($this->type != 'modal')
|
||||||
throw new SlackSyntaxException(sprintf('clear_on_close is not required for %s',$this->type));
|
throw new SlackSyntaxException(sprintf('clear_on_close is not required for %s',$this->type));
|
||||||
@ -136,7 +136,7 @@ final class Modal extends BlockKit
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function notify_on_close(bool $bool): self
|
public function notify_on_close(bool $bool=TRUE): self
|
||||||
{
|
{
|
||||||
if ($this->type != 'modal')
|
if ($this->type != 'modal')
|
||||||
throw new SlackSyntaxException(sprintf('notify_on_close is not required for %s',$this->type));
|
throw new SlackSyntaxException(sprintf('notify_on_close is not required for %s',$this->type));
|
||||||
|
@ -20,7 +20,7 @@ class BlockActionListener //implements ShouldQueue
|
|||||||
{
|
{
|
||||||
protected const LOGKEY = 'LBA';
|
protected const LOGKEY = 'LBA';
|
||||||
|
|
||||||
public $queue = 'slack';
|
// public $queue = 'slack';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle the event.
|
* Handle the event.
|
||||||
|
Loading…
Reference in New Issue
Block a user