-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #438 from ibexa/temp_2.3_to_4.1
Merge branch '2.3' of ezsystems/ezplatform-admin-ui into 4.1
- Loading branch information
Showing
11 changed files
with
319 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/bundle/Resources/public/js/scripts/admin.urlwildcards.list.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(function (doc) { | ||
const typeField = doc.getElementById('url_wildcard_list_type'); | ||
|
||
typeField.addEventListener('change', function () { | ||
this.form.submit(); | ||
}); | ||
})(document); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\AdminUi\Form\Data\URLWildcard; | ||
|
||
final class URLWildcardListData | ||
{ | ||
/** @var string|null */ | ||
public $searchQuery; | ||
|
||
/** @var bool|null */ | ||
public $type; | ||
|
||
/** @var int */ | ||
public $limit; | ||
|
||
public function getSearchQuery(): ?string | ||
{ | ||
return $this->searchQuery; | ||
} | ||
|
||
public function setSearchQuery(?string $searchQuery): void | ||
{ | ||
$this->searchQuery = $searchQuery; | ||
} | ||
|
||
public function getType(): ?bool | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function setType(?bool $type): void | ||
{ | ||
$this->type = $type; | ||
} | ||
|
||
public function getLimit(): int | ||
{ | ||
return $this->limit; | ||
} | ||
|
||
public function setLimit(int $limit): void | ||
{ | ||
$this->limit = $limit; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\AdminUi\Form\Type\URLWildcard; | ||
|
||
use Ibexa\AdminUi\Form\Data\URLWildcard\URLWildcardListData; | ||
use JMS\TranslationBundle\Model\Message; | ||
use JMS\TranslationBundle\Translation\TranslationContainerInterface; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
use Symfony\Component\Form\Extension\Core\Type\HiddenType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextareaType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
final class URLWildcardListType extends AbstractType implements TranslationContainerInterface | ||
{ | ||
private const TYPE_DIRECT = 'url_wildcard.type.direct'; | ||
private const TYPE_FORWARD = 'url_wildcard.type.forward'; | ||
private const PLACEHOLDER = 'url_wildcard.type.all'; | ||
|
||
public function buildForm(FormBuilderInterface $builder, array $options): void | ||
{ | ||
$builder->add('type', ChoiceType::class, [ | ||
'choices' => [ | ||
self::TYPE_DIRECT => true, | ||
self::TYPE_FORWARD => false, | ||
], | ||
'placeholder' => self::PLACEHOLDER, | ||
'required' => false, | ||
]); | ||
|
||
$builder->add('searchQuery', TextareaType::class, [ | ||
'required' => false, | ||
]); | ||
|
||
$builder->add('limit', HiddenType::class); | ||
} | ||
|
||
public function configureOptions(OptionsResolver $resolver): void | ||
{ | ||
$resolver->setDefaults([ | ||
'data_class' => URLWildcardListData::class, | ||
'translation_domain' => 'ezplatform_url_wildcard', | ||
]); | ||
} | ||
|
||
/** | ||
* @return array<\JMS\TranslationBundle\Model\Message> | ||
*/ | ||
public static function getTranslationMessages(): array | ||
{ | ||
return [ | ||
(new Message(self::TYPE_DIRECT, 'ezplatform_url_wildcard'))->setDesc('Direct'), | ||
(new Message(self::TYPE_FORWARD, 'ezplatform_url_wildcard'))->setDesc('Forward'), | ||
(new Message(self::PLACEHOLDER, 'ezplatform_url_wildcard'))->setDesc('All'), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.